Java, when rendering, does everything relative to pixels. This library solves that problem by wrapping Graphics, allowing one to seamlessly render to a virtual infinite plane, then providing Viewport objects that are capable of displaying arbitrary parts of the plane.
This allows one to render things that resize with windows, or even create a "portal" window that shows part of the viewport based on where it is moved. It's also been used for rendering a game, and is a drop-in replacement for Graphics in any AWT rendering systems.
In the demo to the right, for example, the red square is rendered using Graphics. The blue square started out the same size as the red one, but the viewport is coded to always show the same area of the virtual plane, so when the window was resized, it also resized (in this case becoming rectangular and smaller).
Back in the day I had a lovely demo where a ball would bounce around the virtual plane, with many overlapping windows observing it in different ways (and one viewport following the ball's perspective), but that code seems lost. Suffice to say it's possible to do some very fancy stuff with this library.
Download Environment2D.tar.gz.
To use the test script, simply run ./run.sh. Compilation is done using a compile.sh script, and documentation is both online here and can be generated using the document.sh script.