What is Event Delegation Model »



Event Delegation Model
Wen the user generates an event, the component delegates(handovers) that event to a listner.
Listener is an interface that contains same methods, so Listener will delegate the event to one of the methods, finally the method is executed and the event is handled, this is called event delegation model.
Event delegation model is used to [...]

Making a Frame Non-Resizable in Java »



yes u can make the applet program resizable.
In java  there is a method called setResizable method. This method which is responsible for modifying the size of the window on  your applet/awt program   .
In your program, Assume that you have taken a boolean value false for method setResizable then the frame will be non-resizable otherwise frame [...]

AWT Interview Questions »



Q) Why do I get this when using JDK 1.1 under X Windows? java.lang.NullPointerException at sun.awt.motif.MFramePeer.<init>(MFramePeer.java:59) at sun.awt.motif.MToolkit.createFrame(MToolkit.java:153) at java.awt.Frame.addNotify(Frame.java) at java.awt.Window.pack(Window.java)
A. There’s a missing font on your system. Move font.properties from the “lib” subdirectory aside to font.properties.bak Then it won’t look for the font and fail to find it.
The problem occurs because the Motif [...]

AWT Interview Questions »



Q) How would you set the color of a graphics context called g to cyan?
a) g.setColor(Color.cyan); b) g.setCurrentColor(cyan);
c) g.setColor(”Color.cyan”); c) g.setColor(”cyan’);
e) g.setColor(new Color(cyan));
Ans : a.
Q) The code below draws a line. What color is the line?
g.setColor(Color.red.green.yellow.red.cyan);
g.drawLine(0, 0, 100,100);
a) Red b) Green c) Yellow d) Cyan e) Black
Ans : d.
Q) What does the following [...]