The current locations of the event-handling code make sense. Another way that might make sense is to have DialogWindow handle all events, since it is the controlling class in this application. Yet another possibility is to introduce a non- Component controlling class that handles all action events. To convert the DialogWindow program, we'll keep its event-handling code in the same components as before but make the components implement listener interfaces. The following example gives the highlights of the event-related code in the converted DialogWindow program.
Significant changes are in bold .
Since the DialogWindow program is an application, we test it by executing it in the Java interpreter. The following table maps 1.0 events to their 1.1 counterparts. Where no method is listed, the event is always handled in the handleEvent method. The second column lists the 1.0 components that can generate the event type. The third column lists the listener interface that helps you handle the 1.1 equivalents of the listed events.