I.4. Common GUI Event Types and Listener Interfaces

In Section I.3, you learned that information about the event that occurs when the user presses Enter in a text field is stored in an ActionEvent object. Many different types of events can occur when the user interacts with a GUI. The event information is stored in an object of a class that extends AWTEvent (from package java.awt). Figure I.3 illustrates a hierarchy containing many event classes from the package java.awt.event. Additional event types are declared in package javax.swing.event.


Fig. I.3 | Some event classes of package java.awt.event.

Let’s summarize the three parts to the event-handling ...

Get Android™ How to Program, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.