Building a GUI: Events and Listeners

Now that you've learned how to establish a Swing GUI's look, it's time to consider its feel by using events and listeners.

Caution

Don't confuse this use of the phrase "look and feel" with the term PLAF. From a GUI building perspective, "look and feel" refers to the GUI design process.

You've already seen examples of Swing's events and listeners. If you recall, the ColorChooserDemo source code (in Listing 16.3), demonstrated change events and a change listener to respond to selections from a color chart.

Getting to know Swing's events and listeners involves studying the javax.swing.event package. You will also want to carefully review the SDK documentation, to learn what events are fired by each component. ...

Get Special Edition Using Java 2 Standard Edition 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.