go to previous page   go to home page   go to next page


I asked for button objects that do what I want. Somebody else did all the programming. The buttons are components that can be added with minimum effort.

This is similar to going to a hardware store to get components for your home improvement project. Most of the components you need already exist. All you need to do is to install them.

Responding to Events

GUI and human

In Java programming, you can get the GUI components you want merely by asking for them. Most of the work has already been done and is contained in the Swing package. Swing contains windows, frames, buttons, menus and other components.

A user interacts with a GUI application by causing events. The application responds to events in the order they arrive. The picture shows this. Each time the user interacts with a component, an event is sent to the application. Different events are sent to different parts of the application. The application has to work correctly no matter what the user does. (An application usually ignores events that are not relevant to its purpose.)


Move your mouse pointer over the diagram. This is a mouseOver event. Does your browser ignore this event?

Now move your mouse pointer over one of the buttons, below. Does your browser ignore this event?