Myriarch 2.1 for Swing Released

Version 2.1.0 of Myriarch, a simple real-time simulator for pre-gunpowder tactical combat, is now available for download. As with previous project updates, the Myriarch GUI is now based on Swing due to the removal of JavaFX from Oracle’s Java SE distributions. The minimum Java requirement was consequently lowered to Java SE 8, although note that … Continue reading “Myriarch 2.1 for Swing Released”

Java Swing JComboBox Tips

This post is a sequel to Java Swing Tips which formerly contained a shorter version of these tips concerning JComboBox. I decided to extract them into their own post as they got rather long, and the section on custom rendering was not quite correct. As before I’m using Oracle OpenJDK 10 on Windows 10 for … Continue reading “Java Swing JComboBox Tips”

Star Chess 2.1 for Swing Released

Version 2.1.0 of Star Chess, my free mini space conquest game built to demonstrate a multiplayer turn prediction algorithm, is now available for download. As with previous updates to MIME Browser and Tektosyne, the big change is again due to the removal of JavaFX from Oracle’s Java SE distributions: Star Chess is now based on … Continue reading “Star Chess 2.1 for Swing Released”

Swing Hyperlink Labels

JavaFX has a convenient Hyperlink control that’s functionally a button styled as an underlined label, just like an HTML hyperlink. Java Swing has clickable hyperlinks in its JEditorPane control but does not provide them as a separate lightweight control. Fortunately it’s quite easy to roll your own, and that’s what the code below does. JHyperlink … Continue reading “Swing Hyperlink Labels”

Vertical Swing Labels

One limitation of Java AWT/Swing is the inability to rotate controls such as labels, although you can freely rotate elements in a custom-drawn graphics context. I did try invoking a label’s paint method in a paintComponent override after rotating the graphics context but couldn’t get it to work, probably because of the label’s built-in assumptions … Continue reading “Vertical Swing Labels”

Tektosyne 6.3 for Swing Released

Tektosyne 6.3.0 is now available for download. This is an unusual release as there are no functional changes whatsoever to the core library. Instead, the GUI demo application has been entirely rewritten, motivated of course by the recent removal of JavaFX from Oracle’s Java SE distributions. Here’s an overview of the changes. You can find … Continue reading “Tektosyne 6.3 for Swing Released”

Swing High DPI Properties

When Java AWT/Swing got JavaFX-style automatic high DPI scaling in Java SE 9, there were also several new system properties to control that scaling. Unfortunately, as with the various glass.win.* properties of JavaFX (see e.g. here) they are not officially documented. You need to check the developer mailing list and the JDK test sources to … Continue reading “Swing High DPI Properties”

Minimum Size Scaling for Swing Windows

Since Java SE 9, Java AWT/Swing has supported automatic high DPI scaling on Windows and Linux, just like JavaFX. Ironically, this came with a bug that JavaFX used to have until Java 9: Window.setMinimumSize fails to scale the specified width and height on high DPI systems. (Unlike JavaFX, AWT/Swing windows ignore setMaximumSize anyway. Non-window components … Continue reading “Minimum Size Scaling for Swing Windows”

MIME Browser 2 for Swing Released

Version 2.0 of MIME Browser, my free EML message viewer, is now available for download. The big change is the one motivated by the removal of JavaFX from Oracle’s Java SE distributions: MIME Browser is now based on Java AWT/Swing rather than JavaFX. The user interface has become somewhat uglier as a result (below is … Continue reading “MIME Browser 2 for Swing Released”