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 ...

Get Java All-in-One For Dummies, 4th 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.