Understanding Swing Events

Earlier in this chapter, in "Using the Abstract Windowing Toolkit," you learned about the delegation event model and about low-level and semantic events. Swing has its own event package for Swing-specific events. Use the javax.swing.event package for the event listeners and the events themselves; the event sources are the Swing components. The following is a list of the Swing event classes—DocumentEvent is an interface—and their meanings.

Note

Many Swing events, such as those that refer to the "model," assume that you're using the MVC pattern. Read the Swing documentation on MVC or Chapter 13 of Using Java 1.2 before attempting to use these Swing events.

  • AncestorEvent— Ancestor has been added, moved, or removed.

  • ChangeEvent ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 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.