Onscreen Ruler is a simple, open source Java
application which can be used to measure different components
on screen, but it also can be used as an example of solving different
problems in swing (like a draggable window or creating your own
resize window component)
By viewing sources of JSlope Ruler you can learn how to rotate
Java Graphics2D drawing, using LayeredPanes, designing custom
Layout Managers and custom components.
Requirements: it was compiled using JDK 1.5, but it can be recompiled
for other JDK versions with swing support.