A good answer might be:An ordinary Button could be used. |
Design of a New Program
An ordinary Button (a Button object of the Button class) generates actionEvents and needs an ActionListener that implements actionPerformed(). The actionPerformed() method can call System.exit( 0 ) to exit the program. Let us write a program that:
Often a real application will have several ways to quit: the close window button, a menu selection, and perhaps a Button like this program. |
QUESTION 14:Click Here after you have answered the question |