O'Reilly logo

Java™ Drawing with Apache Batik: A Tutorial by Alexander Kolesnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Java for “Scripting”

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.

Figures 8.6 through 8.8 show the initial state of the application and two different results of interaction. Yes, you can see that the application is named appropriately: SVG Interactor.

Figure 8.6. The original state of the application

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required