
12.4 Event Handling 833
nents to the window. If you do this, however, the components added after
the call to the setVisible method will not display until the window is
repainted, for example, as a result of the user resizing the window.
12.4 Event Handling
Now we know how to open a window in an application, and we know how
to display labels and images. But the user can’t interact with our application
yet, except to display a tool tip. We need to add some interactive GUI com-
ponents, like buttons or text fields or lists. By interacting with these com-
ponents the user will control which operations of the program will take
place, and in what order.
GUI ...