creation: 6/26/99 (using AWT); revisions: 01/26/00;
major revision: 01/09/02 (using Swing)
CHAPTER 59 — Buttons and Action Events
We have been doing
The three parts of a GUI application are:
- Components that make up the Graphical User Interface. <—— we've done this; this chapter will do more.
- Listener methods that receive the events and respond to them. <—— we've done this; this chapter will do more.
- Application methods that does useful work for the user. <—— we've not done this, yet.
Soon we will get to the third step,
and you will actually write a full GUI application!
But not yet.
This chapter continues the discussion on how to add button components
to a frame, and how the
actionPerformed() can tell which button was clicked.
- A Button's
- An ActionEvent's
actionPerformed() with several buttons.
What is the name of the method that receives
ActionEvents when a button is clicked?