Event Handling in Java
Event Handling in Java
Event source
Event listener
Event handler
Event Source
An event source is an object that generates an event.
The object registers some handler, which receives
notifications about a specific type of event.
For example,
clicking of a button is an event that is fired by the
button. In this example, the button is the source of the
event and the button-click-event is the notification
that is sent to the handler.
ActionEvent
KeyEvent
MouseEvent
FocusEvent
ItemEvent
WindowEvent
The EventObject class, which is in the java.util
package, is the superclass for all event classes. The
class, EventObject, from which all event objects are
derived, extends the Object class and implements the
Serializable interface.
ActionListener
KeyListener
MouseListener
MouseMotionListener
FocusListener
ItemListener
WindowListener
ActionListener
The ActionListener interface handles the action event.
It is implemented by the class that processes the
action events.