Java Reference
In-Depth Information
Figure B.1. An anonymous subclass of
WindowAdapter
can provide
a
Window-Listener
object that ignores all events except a window closing.
Here is a method that accepts a
JFrame
object and arranges for the Java virtual machine to
terminate when the user closes the frame's window: