Events, Event Sources, and Event Listeners
- User interface events include key presses, mouse moves, button clicks, and so on
- Most programs don't want to be flooded by boring events
- A program can indicate that it only cares about certain specific events
- Event listener:
- Notified when event happens
- Belongs to a class that is provided by the application programmer
- Its methods describe the actions to be taken when an event occurs
- A program indicates which events it needs to receive by installing event listener objects
- Event source:
- Event sources report on events
- When an event occurs, the event source notifies all event listeners