• ActionEvent (对应按钮点击、菜单选择、选择列表项或在文本域中按回车 )
  • AdjustmentEvent (用户调节滚动条)
  • ItemEvent (用户从复选框或列表框中选择一项)
  • KeyEvent (键盘按键按下或释放)
  • MouseEvent (鼠标按下、释放、移动、拖动)
  • MouseWheelEvent (鼠标滚轮转动)
  • FocusEvent (某个组件获得焦点或失去焦点)
  • WindowEvent (窗口状态改变)
接口方法参数/访问方法事件源
ActionListeneractionPerformedActionEvent getActionCommand getModifiersAbstractButtonJComboBoxJTextFieldTimer
AdjustmentListeneradjustmentValueChangedAdjustmentEvent getAdjustable getAdjustmentType*getValueJScrollbar
ItemListenerItemStateChangedItemEvent getItem getItemSelectable* getStateChangeAbstractButtonJComboBox
FocusListenerfocusGainedfocusLostFocusEvent* isTemporaryComponent
KeyListenerkeyPressedkeyReleasedkeyTypedKeyEvent getKeyChar getKeyCode getKeyModifiersText getKeyTxt*isActionKeyComponent
MouseListenermousePreseedmouseReleasedmouseEnteredmouseExitedmouseClickedMouseEvent getClickCount getX getY getPoint* translatePointComponent
MouseMotionListenermouseDraggedmouseMovedMouseEventComponent
MouseWheelListenermouseWheelMovedMouseWheelEvent getWheelRotation getScrollAmountComponent
WindowListenerwindowClosingwindowOpendwindowIconifiedwindowDeiconifiedwindowClosedwindowActivatedwindowDeactivetedWindowEvent* getWindowWindow
WindowFocusListenerwindowGainedFocuswindowLostFocusWindowEvent* getOppositeWindowWindow
WindowStateListenerwindowStateChangedWindowEvent getOldState getNewStateWindow
最后修改:2021 年 05 月 09 日 12 : 45 AM
如果觉得我的文章对你有用,请随意赞赏