Category Archives: Java Swing Interview Questions

What class is at the top of the AWT event hierarchy? | Java Swing Questions

java.awt.AWTEvent is that class which is at the top of the AWT event hierarchy. if they say java.awt.Event, they havent deal with swing or AWT in a while.

Posted in Java Swing Interview Questions | Leave a comment

What is the relationship between clipping and repainting? | Java Swing Questions

When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.

Posted in Java Swing Interview Questions | Leave a comment

Why does JComponent have add() and remove() methods but Component does not? | Java Swing Questions

JComponent have add() and remove() methods but Component does not because JComponent is a subclass of Container, and can contain other components and jcomponents.

Posted in Java Swing Interview Questions | Leave a comment

Can a class be it’s own event handler? Explain how to implement this? | Java Swing Questions

Sure.a Class can be its own event handler. For an example could be a class that extends Jbutton and implements ActionListener. In the actionPerformed method, put the code to perform when the button is pressed.

Posted in Java Swing Interview Questions | Leave a comment

What are the advantages of the event-delegation model over the event-inheritance model? | Java Swing Questions

Event-delegation model has two advantages over event-inheritance model: Event delegation model enables event handling by objects other than the ones that generate the events. This allows a clean separation between a component’s design and its use. It performs much better … Continue reading

Posted in Java Swing Interview Questions | Leave a comment

What is an event and what are the models available for event handling? | Java Swing Questions

Changing the state of an object is called an event. An event is an event object that describes a state of change. In other words, event occurs when an action is generated, like pressing a key on keyboard, clicking mouse, … Continue reading

Posted in Java Swing Interview Questions | Leave a comment

Which method is used for setting security in applets? | Java Swing Questions

The Method is used for setting security in applets whihc is defined as : setSecurityManager()

Posted in Java Swing Interview Questions | Leave a comment

What is the lifecycle of an applet? | Java Swing Questions

An Applet is basscially lifecyacle is defined as : Init( ) method : called when an applet is first loaded. Start( ) method : called each time an applet is started . Paint( ) method : called when the applet … Continue reading

Posted in Java Swing Interview Questions | Leave a comment

When we should go for codebase in applet? | Java Swing Questions

If the applet class is not in the same directory,when we used to codebase.

Posted in Java Swing Interview Questions | Leave a comment

Which method is used by the applet to recognize the height and width? | Java Swing Questions

Method is used by the applet to recognize the height and width which is defined as : getParameters()

Posted in Java Swing Interview Questions | Leave a comment