An event is one of the most important concepts in Java. The change in the state of an object or behavior by performing actions is referred to as an Event in Java. Actions include button click, keypress, page scrolling, or cursor movement.
Some of the most used Event classes are:
Event Class | Listener Interface | Methods | Descriptions | |
1. | ActionEvent | ActionListener | actionPerformed() | ActionEvent |
2. | AdjustmentEvent | AdjustmentListener | adjustmentValueChanged() | Adjustment events |
3. | ComponentEvent | ComponentListener | componentResized(), componentHidden() | An event occurs when |
4. | ContainerEvent | ContainerListener | componentRemoved() componentAdded() | The event is fired |
5. | FocusEvent | FocusListener | focusLost() and focusGained() | Focus events include |
6. | ItemEvent | ItemListener | itemStateChanged() | Item event occurs |
7. | KeyEvent | KeyListener | keyPressed(), | A key event occurs |
8. | MouseEvent | MouseListener and | mouseClicked(), mouseReleased() are the mouseListener methods. mouseDregged() and mouseMoved() are the MouseMotionListener() methods. | A mouse event occurs |
9. | MouseWheelEvent | MouseWheelListener | mouseWheelMoved(). | MouseWheelEvent |
10. | TextEvent | TextListener | textChanged() | TextEvent occurs |
11. | WindowEvent | WindowListener | windowActivated(), windowDeiconified(). | Window events occur |
0 comments:
Post a Comment