We will build a simple Swing application, similar to those in previous chapters. This time, however, it will respond to actions. To achieve this level of interactivity we use nothing other than the Java language.
The application will display a couple of shapes. If we move the cursor over one of the figures, the figure will change its color and the other figure responds by changing its size. Also, let both figures respond to the click event by displaying a message box.