A good answer might be:

No. Registering just tells the Java system where to send the events. They go in one direction, from GUI component (in this case the close button) to event listener (in this case WindowQuitter.


Sample Run

This program is suitable for "copy-paste-save-and-run" using Notepad. It would be a really good idea to try it, and to hack upon the program a bit. You no longer have to type control-c to kill the program; just click on the close-window button.

C:\> javac GUItester.java
C:\> java GUItester
C:\>

QUESTION 8:

Is the listener object in this program an object separate from the Frame object?