We have been doing event-driven programing. The three parts of a GUI application are:
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.
setActionCommand()
method.getActionCommand()
method.actionPerformed()
with several buttons.