Event Model - I
The user can interact with the GUI on many of its components, by clicking a button, typing in text, etc. These actions cause an Event to be generated, which will be reported by the system to a class which is an Event Listener, and which will have an event handler method for that event. This method will provide the appropriate response to the user's action.
An Event Listener is an instance of any class that wants to receive events.
An event source is an object that generates events.. An event source will keep a list of event listeners who want to be notified for particular events.
- button1.addActionListener ( eventclass );