Chapter 2
Handling Events
In This Chapter
Understanding important event concepts
Working with event-handling classes and interfaces
Responding to button clicks
Using inner classes for event handling
Providing an Exit button
Dealing with the Close button
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access