Back to demo index

ZoomPane demo

This demo illustrates the use of the ZoomPane widget by drawing a triangle and a box and placing the widget in an applet. The ZoomPane widget manages an Affine Transform common to all java.awt.Shape objects in the scene, thereby enabling the joint scaling, translation and rotation of all painted objects.

Widget javadoc: ZoomPane
How to use: Use the keyboard (Page Up or Page Down) or the mouse wheel for zooming. Use the scrollbars or the keyboard for translating. Right click and select the "Show magnifier" option for testing the magnifier.
How to make your own: In order to provide useful content, developers need to create a derived class of ZoomPane and define the paintComponent(Graphics2D) method. This demo applet defines the above method to paint a triangle and a box.
Prerequites:
  • Java 6
  • Firefox 3 on Linux or Windows, or Internet Explorer on Windows (there is known issues with Safari, Opera and Firefox on MacOS)