Option to keep Stages always on top on JavaFX 8 ?

Herve Girod herve.girod at gmail.com
Wed Dec 11 14:27:10 PST 2013


I know that this option is not available for JavaFX 2.2, but is it planned
for Java 8, and for what time frame if the answer is yes (for example, for
initial release or later ?) .

This is an important feature for us, because we need to show JavaFX content
on top of Windows created on other programs (for example, elements on top
of a cartographic system produced by a C++ program, but it's just an
example).

As there is no alwaysOnTop API on Stage in JavaFX, a workaround is to
create a Swing Window, put a JFXPanel in it, and the Scene in the JFXPanel.
However, multitouch gestures are not handled by Swing, so these are not
working in this case.

Our only option is then to put a Stage toFront(), and hope that the other
content won't pop on top of JavaFX while the user click on it.

This is OK if no part of our Stage need to be transparent to user events,
and also if all of the other Windows are created prior to the JavaFX stage
is created, but it is not always possible, and we envision cases where our
workaround won't work.

Regards,

Hervé


More information about the openjfx-dev mailing list