ComboBox Celebration Update

With the release of Java SE 8 Update 60 that brought WPF-style DPI scaling my two JavaFX open-source projects (MIME Browser and Star Chess) were due for an update. But then several users discovered a nasty JavaFX bug that had been introduced in Java SE 8u40 but only occurs on touch screen systems. Specifically, clicking on any ComboBox not in focus would immediately and permanently freeze the JavaFX application so it had to be shut down with Task Manager! This bug turned out to be the result of a missing recursion check in accessibility code which was triggered by the presence of a touch screen.

For Java SE 8u40/60 you could avoid the bug by specifying the Java runtime flag -Dglass.accessible.force=false which simply disables accessibility altogether. In the recently released Java SE 8u66 the bug is fixed so this flag is no longer necessary. Please take note that Oracle simultaneously released the security update Java SE 8 Update 65 which does not seem to contain the ComboBox fix – make sure to get Update 66 on the Java download page which annoyingly puts 8u65 on top.

With the ComboBox bug resolved, here are the MIME Browser and Star Chess updates. I removed my (now unnecessary) manual DPI scaling code from both applications, then tested them at 120 DPI because JavaFX special-cased that resolution to avoid blurry text. More on the results below.

MIME Browser 1.3.3

MIME Browser: The self-sizing display turned out to work pretty well at 120 DPI, so I only had to widen the Modified & Size columns of the message list a bit to compensate for the lack of scaling at that setting. Two additional bugs were fixed: sorting messages by name didn’t work at all because I had forgotten to supply a custom comparer for the HBox wrapping each path; and the text view for the current message now remembers both custom font and zoom selection (previously one would reset the other).

Star Chess 2.0.2

Star Chess: Here the display is very precisely sized to hold a dense graphical data layout, and there was no way to make this work at 120 DPI with scaling disabled. So if you’re on Windows with that setting you’ll have to use the Java startup flag -Dglass.win.minHiDPI=1 to enable the new JavaFX DPI scaling at all resolutions. For the record, I was unable to see the blurry text that’s supposed to occur at 120 DPI, but I currently have only 4K monitors where the difference would be hard to see.

In other news, the right-click context menu once again shows up properly. Apparently some recent JavaFX version started producing empty context menus when they are initialized before the application window is shown. The bug disappeared when I switched my ContextMenu instance to lazy initialization. Finally, I added package information to the Javadoc class reference, and removed all help files from the JAR file which they had been accidentally (and redundantly) packaged with.

2015-11-07: Like WPF, JavaFX uses hardware acceleration that can cause immature Windows 10 display drivers to trip over themselves, forcing frequent driver restarts. If that happens on your system, try using the Java startup flag -Dprism.order=sw to run JavaFX in software mode. This applies to both projects.

Leave a Reply