Event Handling
Event Handling
Events are supported by the java.awt.event package. Handling events is based on the delegation event model. It defines standard and consistent mechanisms to generate and process events.
Concept: a source generates an event and sends it to one or more listeners. The advantage of this design is that the application logic separated from the user interface logic
Event Model
An event is an object that describes a state change A source is an object that generates an event A listener is an object that is notified when an event occurs. A source must register listeners General form:
public void addTypeListener(TypeListener el)