Event, listener interface and add- and remove-methods
| Components supporting this event
|
|---|
ActionEvent ActionListener addActionListener( ) removeActionListener( )
| JButton, JList, JTextField, JMenuItem and its derivatives including JCheckBoxMenuItem, JMenu, and JpopupMenu.
|
AdjustmentEvent AdjustmentListener addAdjustmentListener( ) removeAdjustmentListener( )
| JScrollbar and anything you create that implements the Adjustable interface.
|
ComponentEvent ComponentListener addComponentListener( ) removeComponentListener( )
| *Component and its derivatives, including JButton, JCanvas, JCheckBox, JComboBox, Container, JPanel, JApplet, JScrollPane, Window, JDialog, JFileDialog, JFrame, JLabel, JList, JScrollbar, JTextArea, and JTextField.
|
ContainerEvent ContainerListener addContainerListener( ) removeContainerListener( )
| Container and its derivatives, including JPanel, JApplet, JScrollPane, Window, JDialog, JFileDialog, and JFrame.
|
FocusEvent FocusListener addFocusListener( ) removeFocusListener( )
| Component and derivatives*.
|
KeyEvent KeyListener addKeyListener( ) removeKeyListener( )
| Component and derivatives*.
|
MouseEvent (for both clicks and motion) MouseListener addMouseListener( ) removeMouseListener( )
| Component and derivatives*.
|
MouseEvent[68] (for both clicks and motion) MouseMotionListener addMouseMotionListener( ) removeMouseMotionListener( )
| Component and derivatives*.
|
WindowEvent WindowListener addWindowListener( ) removeWindowListener( )
| Window and its derivatives, including JDialog, JFileDialog, and JFrame.
|
ItemEvent ItemListener addItemListener( ) removeItemListener( )
| JCheckBox, JCheckBoxMenuItem, JComboBox, JList, and anything that implements the ItemSelectable interface.
|
TextEvent TextListener addTextListener( ) removeTextListener( )
| Anything derived from JTextComponent, including JTextArea and JTextField.
|