The JFC Swing Tutorial: A Guide to Constructing GUIs (2nd Edition)
< Day Day Up > |
http://java.sun.com/docs/books/tutorial/uiswing/events/index.html This chapter gives you details about writing event listeners. It assumes you've already read Handling Events (page 19) in Chapter 2, which gives an overview of the event model. You might not need to read this section, at all. Your first source of information for event information should be the how-to section for the component in question. You can find the appropriate section using A Visual Index to Swing Components (page 37) in Chapter 3. Each component's section shows code for handling the events most commonly needed when implementing the component. For example, How to Use Check Boxes (page 163) in Chapter 7 shows you how to handle mouse clicks on check boxes using an item listener. This chapter contains the following sections:
If you're having some hard-to-debug problems related to handling events, you may find the solutions in Solving Common Event-Handling Problems (page 739) in the Appendix. Some Event-Handling Examples Multiple Listeners Example General Information about Writing Event Listeners Design Considerations Getting Event Information: Event Objects Concepts: Low-Level Events and Semantic Events Event Adapters Inner Classes and Anonymous Inner Classes The EventHandler Class Listeners Supported by Swing Components Listeners That All Swing Components Support Other Listeners That Swing Components Support Listener API Table Summary Questions and Exercises Example Programs |
< Day Day Up > |