Event Handling & AWT - Event Delegation Model

191 views 5 slides Sep 16, 2024
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

Event Delegation Model


Slide Content

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
Tags