DialogWindow handles action events for the components it contains. SimpleDialog handles action events for the components it contains. Now that we know which objects generate which events, it's easy to determine which interfaces the event handlers should implement. Now all that's left is to implement the event-handling methods and register the event listener. The following example gives the highlights of the event-related code converted DialogWindow program.
Significant changes are in bold .
This change makes the empty method bodies unnecessary. The following are the highlights of a DialogWindow class that uses an inner class to handle window events. Significant changes from the 1.1 window listener version are in bold . By using the DialogWindow program, both as an applet and as an application, we can see that it handles all events properly.