Java Reference
In-Depth Information
TABLE 11-13 Events Generated by a GUI Component, the Listener Interface, and the
Name of the Method of the Interface to Handle the Event (continued)
GUI Component
Event Generated
Listener Interface
Listener Method
JComponent
ComponentEvent
ComponentListener
componentResized
JComponent
ComponentEvent
ComponentListener
componentShown
JComponent
FocusEvent
FocusListener
focusGained
JComponent
FocusEvent
FocusListener
focusLost
Container
ContainerEvent
ContainerListener
componentAdded
Container
ContainerEvent
ContainerListener
componentRemoved
JList
ActionEvent
ActionListener
actionPerformed
JList
ItemEvent
ItemListener
itemStateChanged
JMenuItem
ActionEvent
ActionListener
actionPerformed
JScrollbar
AdjustmentEvent
AdjustmentListener
adjustmentValueChanged
JTextComponent
TextEvent
TextListener
textValueChanged
JTextField
ActionEvent
ActionListener
actionPerformed
Window
WindowEvent
WindowListener
windowActivated
Window
WindowEvent
WindowListener
windowClosed
Window
WindowEvent
WindowListener
windowClosing
Window
WindowEvent
WindowListener
windowDeactivated
Window
WindowEvent
WindowListener
windowDeiconified
Window
WindowEvent
WindowListener
windowIconified
Window
WindowEvent
WindowListener
windowOpened
1
1
Even though key and mouse are not GUI components, they do generate events. Table
11-14 summarizes the events generated by the key and mouse components.
TABLE 11-14 Events Generated by key and mouse Components
Event Generated
Listener Interface
Listener Method
key
KeyEvent
KeyListener
keyPressed
key
KeyEvent
KeyListener
keyReleased
key
KeyEvent
KeyListener
keyTyped
mouse
MouseEvent
MouseListener
mouseClicked
 
Search WWH ::




Custom Search