O'Reilly logo

Java All-in-One For Dummies, 4th Edition by Doug Lowe

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 2

Handling Events

In This Chapter

arrow Understanding important event concepts

arrow Working with event-handling classes and interfaces

arrow Responding to button clicks

arrow Using inner classes for event handling

arrow Providing an Exit button

arrow Dealing with the Close button

arrow Taking another look at a button-click program

In Book VI, Chapter 1, I show you how to create Swing frames that include panels, labels, and buttons. Those frames don't do anything other than sit there, however. They look good, but they're completely unresponsive. Click them all you want, but they don't do anything. They're kind of like teenagers.

In this chapter, you get those buttons to do something. Specifically, you find out how to write code that's executed when a user clicks a button. The technique you use to do that is 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