Swing事件源通常可能触发事件及对应事件监听器
事件源 |
事件对象 |
事件监听器 |
JFrame | MouseEvent WindowEvent |
MouseEventListener WindowEventListener |
AbstractButton (JButton, JToggleButton, JCheckBox, JRadioButton) |
ActionEvent ItemEvent |
ActionListener ItemListener |
JTextField JPasswordField |
ActionEvent UndoableEvent |
ActionListener UndoableListener |
JTextArea | CareEvent InputMethodEvent |
CareListener InputMethodEventListener |
JTextPane JEditorPane |
CareEvent DocumentEvent UndoableEvent HyperlinkEvent |
CareListener DocumentListener UndoableListener HyperlinkListener |
JComboBox | ActionEvent ItemEvent |
ActionListener ItemListener |
JList | ListSelectionEvent ListDataEvent |
ListSelectionListener ListDataListener |
JFileChooser | ActionEvent | ActionListener |
JMenuItem | ActionEvent ChangeEvent ItemEvent MenuKeyEvent MenuDragMouseEvent |
ActionListener ChangeListener ItemListener MenuKeyListener MenuDragMouseListener |
JMenu | MenuEvent | MenuListener |
JPopupMenu | PopupMenuEvent | PopupMenuListener |
JProgressBar | ChangeEvent | ChangeListener |
JSlider | ChangeEvent | ChangeListener |
JScrollBar | AdjustmentEvent | AdjustmentListener |
JTable | ListSelectionEvent TableModelEvent |
ListSelectionListener TableModelListener |
JTabbedPane | ChangeEvent | ChangeListener |
JTree | TreeSelectionEvent TreeExpansionEvent |
TreeSelectionListener TreeExpansionListener |
JTimer | ActionEvent | ActionListener |
该表列出了Swing事件源通常可能触的发事件及对应的事件监听器,它们也位于java.awt.event包和javax.swing.event包中。