So, once again, we are in the process of converting our existing Java application, which makes full use of Swing to use JavaFX. However, the application will not fully use JavaFX. This seems to cause some problems with Alerts / Dialogs and modality. We are currently using Java 8u40.
The main application mainly consists of a JFrame with a menu. The main content area is JDesktopPane, and clicking on MenuItem opens up new JInternalFrames inside DeskopPane. The screens we convert to JavaFX are basically JFXPanels inside a JInternalFrame. Any warnings / dialogs opened from JFXPanels are modal for the panel itself, but not for JInternalFrame, DeskopPane, Menu, etc.
In the DialogPane documentation, I read that in future releases of JavaFX they plan to introduce some lightweight dialogs and even, possibly, internal frames, so we may have to wait a bit for this function. But ideally, when you open a new Alert / Dialog, it will be modal for the entire Application.
EDIT: Currently, for modal dialogs, the following is done:
((Stage)getDialogPane().getScene().getWindow()).setAlwaysOnTop(true);
This makes the dialog always displayed on top, but the dialog also remains on top of other applications, even if our main application is minimized. It also does not block the input of any Swing components in the frame.
source share