An easy-to-use ZUI implementation for Java
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


An easy-to-use ZUI (Zoomable User Interface) implementation for Java.

This project is build with Maven. Use mvn install to generate it as a jar in the target/ directory. Alternatively the project can be used as dependency in other Maven projects (see [below] (#maven-integration)).

In order to create a ZUI component you can use the following snippet:

Renderpass renderpass = new Renderpass() {

  public void draw(final Graphics2D g, final KanvasContext ctx) {
    // draw here
    // ctx can be used to convert between canvas and component coordinates

  public boolean click(final Camera cam, final Point2D p, final MouseEvent e) {
    // react to events

  public void getBoundingBox(final RectangularShape rectangularShape) {
    // set bounding box for the render pass

RenderpassPainter painter = new RenderpassPainter();
Canvas canvas = new Canvas(painter, width, height);
// ...
parent.add(canvas); // adds the canvas to the parent component
canvas.reset(); // scrolls the bounding-box of the painter into view

In the package jkanvas.examples are examples that show how to use the canvas for various tasks. Furthermore the [wiki] ( is meant to explain how to use various classes and interfaces.

Maven Integration

In order to use JKanvas within a Maven project you can use the following dependency (in the <dependencies> section -- note that the X.X.X in the version tag must be replaced with the current version):


However, this requires an additional repository in the repositories section (<repositories>) of the pom.xml file:


When using [Eclipse] ( the current snapshot can be used by having the JKanvas project open and altering the version of the dependency to X.X.X-SNAPSHOT where X.X.X is the upcoming version.