O'Reilly logo

Sams Teach Yourself Java™ 6 in 21 Days by Laura Lemay, Rogers Cadenhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Responding to User Input

To make a graphical user interface completely functional in a Java program, you must make the interface receptive to user events.

Swing handles events with a set of interfaces called event listeners. You create a listener object and associate it with the user interface component being monitored.

Today, you learn how to add listeners of all kinds to your Swing programs, including those that handle action events, mouse events, and other interaction.

When you’re finished, you create a full Java application using the Swing set of classes.

Event Listeners

If a class wants to respond to a user event under the Java event-handling system, it must implement the interface that deals with the events. These interfaces are called ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required