The changing of the state of an object is known as an event & the mechanism to control such events is known as event Handling.
e.g., click on a button, dragging a mouse, scrolling page, selecting an item from a list, etc.
The event can be classified into 2 categories:
The events require direct interaction with the user.it generated as a consequence of the person that interacts with the graphical component in GUI. e.g., clicking the button, Moving the mouse. Enter values using a keyboard, scrolling the page.
the event requires the interaction with the end-user that is known as a background event. e.g., software or hardware failure, operating system interrupts, the timer expires.
The event Handling mechanism controls the event & decides the action about if an event occurs what will happen. It has the code which is called an event handler that is executed when the event get occurs. The delegation event model uses to handle the event. The model indicates a standard mechanism to generate & handle the events.
An object on which an event occurs. It is responsible for providing the information of the released event to its handler.
It is responsible to generate responses to events. We can say a listener is an object it waits until it receives an event, once an event gets received the listener process the event then returns.
The main benefit of this model is that UI logic is completely get separated from the logic that generates an event. The UI element is able to delegate the processing of events to a separate piece of code. In the model, the listener needs to be registered with the source object so the listener can receive the event notification. It is an effective way to handle the event.