Path Plotter
A browser drawing editor that turns shapes and paths into Java2D source code for a Swing JPanel.
- Type
- Personal
- Year
- 2026
- Role
- Solo Developer
Overview
Path Plotter is a visual editor for Java2D geometry. You draw or trace artwork in the browser with lines, quad and cubic curves, rectangles, ellipses, arcs, and text, then edit the curves, combine and clip shapes, add multi-color gradients, and copy either a Java fragment or a complete runnable class for a Swing JPanel.
Writing Java2D by hand means guessing coordinates and recompiling to see the result. Path Plotter lets you see the shape first and get the code after.
What I built
The canvas and the Java generator have to agree on everything: drawing order, boolean operations (shapes combined or subtracted with Java's Area), and which clip region owns which shapes. Both read the same shared scene rules, so what you see is what the generated code paints.
Some features have no direct Java2D equivalent. The Perspective tool lets you drag a shape's corner pins to distort it onto any four-sided outline, but Java2D has no perspective transform, so the tool writes the distortion into the path's own points: rectangles and ellipses become paths first, and text and images are refused rather than approximated. Single segments can also be exported as Line2D, QuadCurve2D, or CubicCurve2D, and fall back to GeneralPath once the geometry outgrows them.
It is a static site with no build step and no framework. The scripts load in a fixed order under one namespace, so it runs on GitHub Pages or straight from index.html. Projects autosave in the browser and can be exported as JSON. A regression suite compares the generated Java against recorded outputs, and a compilation test runs the output through javac.

