A good answer might be:
No. actionPerformed()
does not depend on the buttons' texts.
This is an advantage of using
setActionCommand().
End of the Chapter
That's all the action for this chapter. If one or two topics have not yet clicked, you may wish to review the following.
- Details of the actionPerformed() method.
- The setActionCommand() method.
- The getActionCommand() method.
- Using one actionPerformed() method with two buttons.
The next chapter will discuss how to write a complete GUI application, complete with application code. About time.
You have reached the end of the chapter.