Showing posts with label event Sources. Show all posts
Showing posts with label event Sources. Show all posts

Saturday, 1 February 2014

Event Handling

The event. Event handling is fundamental to Java programming because it is integral to the creation of applets and other types of GUI-based programs. 


The Delegation Event Model

The modern approach to handling events is based on the delegation event model, which defines standard and consistent mechanisms to generate and process events. Its concept is quite simple:a source generates an event and sends it to one or more listeners.In this scheme, the listener simply waits until it receives an event. Once an event is received, the listener processes the event and then returns.
                         In the delegation event model, listeners must register with a source in order to receive an event notification. This provides an important benefit: notifications are sent only to listeners that want to receive them.an event was propagated up the containment hierarchy until it was handled by a component.