Java GUI Event Handling
When users interact with a GUI application, they perform actions that include but are not limited to moving the mouse around the window, clicking buttons, moving sliders, selecting checkboxes, and entering text into fields. All of these actions must be handled by the application.
To simplify the process of handling these actions, the AWT provides an event-handling mechanism, which has the component generating the event register an event handler for that specific event. These components effectively delegate the responsibility for handling these events to other classes, which is why this approach is referred to as the delegation model.
Using the delegation model, the client handlers are registered with the GUI component ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access