The Big Picture

All of the action, as far as events and listeners are concerned, starts in the java.util package. java.util comes with a class and an interface—EventObject and EventListener, respectively, which form the foundation of the delegation event model. EventObject is a simple class that does nothing more than keep track of its event source, and EventListener is a tagging[1] interface, which all listeners extend. EventListener and EventObject anchor hierarchies of listeners and events, respectively. Figure 9-3 shows the event listeners, all of which extend the java.util.EventListener interface.

[1] A tagging interface does not define any methods.

Figure 9-3. Event Listener Interfaces. All of the event listener interfaces shown above reside ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition 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.