Some visual issues with a test application

Mark Raynsford org.openjdk at
Sun Oct 14 20:22:23 UTC 2018


I've been developing with Swing for many years, and I'm just now giving
JavaFX a serious look now that the distribution issues are fixed
(packages on Maven Central and the like).

I've run into a couple of odd issues and I'm not sure that either of
them are my fault.

I've been putting together a little API and GUI application for
browsing OSGi repositories:

I've recorded the issues here:

You may notice that things look a little odd in that all windows appear
to be fullscreen. This is because I'm using a tiling window manager
(i3). Historically, Swing had a bit of trouble with this sort of window
manager. I'm not sure if JavaFX also does.

The first issue: The menu bar I created seems to behave erratically.
Sometimes I can click on the menu to open it, other times it flashes
open and then immediately closes. In both cases, the menu seems to be
detached from the menu bar (there's a gap between the menu and the bar).

The menu is created here and added to a BorderPane:

The second issue: Icons set on TreeItem values seem to be corrupted
when the TreeTableView containing them is scrolled. You can see this
happen in the video. The table in question is populated from an
immutable snapshot of data returned by the underlying repository API.
Once a repository is added, the table is populated once and then does
not change until the user adds another repository.

Double clicking on a row "selects" a bundle from the repository
and this triggers a refresh of the table view. When I scroll up and
down, it seems like icon views are incorrectly reused from other rows.

The entirety of the table configuration happens here:

Icons are set on the tree table nodes here:

Any advice would be appreciated. "YOU ARE NOT USING THE API CORRECTLY"
criticism is also welcome.

Mark Raynsford |

More information about the openjfx-dev mailing list