Now that you have learned the event-handling classes and interfaces, it is time to work through a programming example so that you can see how they are used in a window application. Listing 13.1 presents the Event Sampler program. This program shows how the events of common AWT components are handled.
When you run EventApp, it displays the window shown in Figure 13.1. It provides samples of the following GUI components:
Text field— Typing Enter in the text field causes the contents of the text field to be converted to uppercase.
Text area— The text area is used to display the results of handling the events of the other GUI components.
Button— Clicking the button clears the contents of the text area.
Canvas— Clicking ...