Design Patterns Java™ Workbook

(Michael S) #1
Appendix B. Solutions

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:

Free download pdf