Java Reference
In-Depth Information
Review Questions
1.
What three entities are involved in the event delegation model?
2.
When a Button is clicked, which event occurs:
a.
ItemEvent
b.
ActionEvent
c.
MouseClickedEvent
d.
Both a and b
e.
Both b and c
3.
How many methods are in the ActionListener interface? Name them.
4.
True or False: All components generate an ActionEvent.
5.
True or False: All components generate a MouseEvent.
6.
True or False: A component can have either 0 or 1 listener for an event.
7.
If a component generates a KeyEvent, name the interface that a listener must imple-
ment. What method in the component's class is invoked to register this listener?
8.
When the user clicks the X on a Frame or JFrame, a WindowEvent is generated. Which
method in WindowListener is invoked?
a.
public void windowClosed(WindowEvent w)
b.
public void windowIconified(WindowEvent w)
c.
public void windowClosing(WindowEvent w)
d.
First a, then c
e.
none of the above
9.
The MouseListener has five methods in it. Does it have a corresponding event adapter
class? If yes, what is the name of the adapter class?
10.
Clicking a java.awt.Checkbox generates what type of event? What about clicking a
javax.swing.JCheckBox?
11.
What two classes are used to create a group of AWT radio buttons?
12.
What two classes are used to create a group of Swing radio buttons?