This repo includes an example of a Java Panel, configured in order to allow the user to zoom in and out according to the position of the mouse and move the content of the panel. The libraries used for the graphics are the java libraries AWT and Swing.
In the example code there is a picture with a map loaded in a Panel, and the user can roll the mouse to zoom in and out, or click and drag with the mouse to move through the image.
The executable jar and the required image are located in the folder Execute. So if you want to test the app you must:
- Download the Execute folder
- Run the jar file:
You can run the jar either by running the Execute.bat file if you are using Windows, either by executing the command:
java -jar Zoomable_Panel.jar
from inside the Execute folder. In order for the app to run properly, the jar file and the image called "map.jpg" must be in the same folder.
Below you can see a screenshot of the app: