Yes, I'm completely mad.
Yes, I know about Wakefield, and Caciocavallo, both have been in progress(ish) for years... nothing has arrived in mainline JDK to fix the internal JDK bugs that prevent a proper Wayland AWT Toolkit. There is a horrid fix in Caciocavallo which uses reflection to monkey about inside the JDK, and needs many command line switches to circumvent security controls...
Yes, I know about XWayland - it's horribly broken for Swing applications (try one!) and is intended as a stop gap, not a long term solution.
By re-using the interfaces of Swing, and providing completely new implementations that lean on Wayland and maybe a component toolkit..
Presently, we build a new module / package
com.ashbysoft.swingland, so client code will have to adjust imports to use us - this is by design
and also avoids horrible pain in replacing a system module (
java.desktop) which is apparantly impossible without rebuilding the whole JDK..
I've chosen to use Ant as it provides just enough build tooling, is self contained, plus I know how to drive it.
% ant [clean|compile|package (default)] [...] .....
% ant [test-wayland|test-swingland|test] .....
test-wayland target directly creates a Wayland window on screen, fills it with random dots for a few seconds and terminates.
test-swingland target runs a Swing GUI application that extends a
JComponent and draws stuff in the
It has a working menu bar that demonstrates the popup windows and menuing logic, you can exit via it!
test-swingland also demonstrates
a couple of pop up
JDialogs (Swing flavour), one with some
JButtons in a
JSplitPane, one with a
more to come as I write it! The
test target runs both tests. All tests save an
INFO level log to the
I have started importing some of the standard Swing demos as additional test applications, they should work largely unaltered apart from import statements..
% java -cp bin/test.jar com.ashbysoft.test.[TopLevelDemo|ButtonDemo]
Font EDitor is a dogfooding application written with
swingland to edit bitmap font files (
res/cursors) used by
% java -jar bin/fed.jar -f <font file> [--help]
FontTest was written to test both the PCF font support and font transformations (ie: rotation), run it:
% java -cp bin/test.jar [--help] [-r] <font name> [...]
-r rotates the specified fonts instead of simply printing a line of each,
font name can be one of: a logical name eg:
a resource path in the
swingland.jar file for built-in bitmap fonts eg:
/cursors/CURLY; a file path for PCF fonts, either absolute or
relative to paths in
XDG_DATA_DIRS (by default:
I've ported my own applications to Swingland, noteably: