Chapter 6. Java Core APIs

Event Handling

Packages

java.awt.event, javax.swing.event, java.util (some classes)

Use: J2SE (delegation model since JDK1.1)

Overview

Event handling allows two or more objects to communicate about a change of state within a system. In an event-based system, one object acts as the event producer, and creates an event object to represent some change in its state. It then passes the event to one or more registered receivers by calling some method on each receiver object.

Event handling has been part of Java since the beginning. It is part of the AWT and, since J2SE v1.2, has also been ...

Get Applied Java™ Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.