Event
Delegation
Model
Event Delegation Model
– Modern approach for event handling.
– Defines a standard and compatible
mechanism to generate and process
events.
– In this model, a source generates an event
and forwards it to one or more listeners.
– The listener waits until it receives an
event. Once it receives the event, it is
processed by the listener and returns it.
– The listener must be registered with a
source to receive an event.
Delegation Event Model
– The main advantage of the Delegation
Event Model is that :
– the application logic (to process events) is
completely separated from the interface
logic (that generates events).
– Basically, an Event Delegation Model is
based on the following three components:
• Events
• Events Sources
• Events Listeners
Delegation Event Model
Delegation Event Model
Source Listener
Event
MyListener
ActionEvent

Event Handling & AWT - Event Delegation Model

  • 1.
  • 2.
    Event Delegation Model –Modern approach for event handling. – Defines a standard and compatible mechanism to generate and process events. – In this model, a source generates an event and forwards it to one or more listeners. – The listener waits until it receives an event. Once it receives the event, it is processed by the listener and returns it. – The listener must be registered with a source to receive an event.
  • 3.
    Delegation Event Model –The main advantage of the Delegation Event Model is that : – the application logic (to process events) is completely separated from the interface logic (that generates events). – Basically, an Event Delegation Model is based on the following three components: • Events • Events Sources • Events Listeners
  • 4.
  • 5.
    Delegation Event Model SourceListener Event MyListener ActionEvent