Handling Events

The user communicates with window programs by performing actions such as clicking a mouse button or pressing a key on the keyboard. These actions result in the generation of events. The process of responding to an event is known as event handling. The invocation of an event handling method is the end result of an event's generation. Window programs are said to be event-driven because they operate by performing actions in response to events.

The JDK 1.02 supported an approach to event handling referred to as an inheritance model. In this approach, events are handled by subclassing window components and overriding their action(), handleEvent(), and other methods. These methods return True or False to indicate whether they have successfully ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.