Event Handling
In Java, GUI programs, such as applets, are event driven. Thus, event handling is at the core of successful GUI programming. Most events to which your program will respond are generated by the user. These events are passed to your program in a variety of ways, with the specific method depending upon the actual event. There are several types of events, including those generated by the mouse, the keyboard, and various controls, such as a push button. AWT-based events are supported by the java.awt.event package.
Before we start, it must be mentioned that it is not possible to fully discuss Java’s event handling mechanism. Event handling is a large topic with many special features and attributes, and a complete discussion is well beyond ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access