An anonymous class that extends an existing class
Program uses an anonymous class
- that extends the WindowAdapter class
- to instantiate an object
- to handle "window" events
- fired by the close button in the upper-right corner of the Frame
object shown in Figure 2.
This class also uses the source-listener event model,
- and uses an instance initializer to display the name of the class file.