15 Event Handling


An event is any happening or occurring. Event-handling code is the heart of every useful application. All event-driven programs are structured around their event-processing model. Java events are a part of the Java Abstract Windowing Toolkit (AWT) package. An applet is basically an event-driven program in which events are generated by mouse, keyboard and window or other graphical user interface components. The events are passed to the events methods and there are specific methods for recognizing and handling the events.

There are two main models for handling events in Java: the old model, called the Inheritance Event Model, is obsolete; the new model, called the Delegation Event Model, will be discussed ...

Get Java Programming now with O’Reilly online learning.

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