title: Making JavaFX Alerts/Dialogs Modal within Swing Application
body: <p>So once again we are in the process of converting our existing Java application that was using entirely Swing to using JavaFX.  However, the application will not be using JavaFX entirely.  This seems to be causing some issues with Alerts/Dialogs and modality.  We are currently using Java 8u40.</p>
  
  <p>The main application is basically in a JFrame that has a Menu. The main content pane is JDesktopPane and clicking a MenuItem opens new JInternalFrames within the DeskopPane. Screens we are converting to JavaFX are basically JFXPanels within a JInternalFrame at the moment. Any Alerts/Dialogs that are opened from the JFXPanels are modal to the panel itself, but not to the JInternalFrame, DeskopPane, Menu, etc.</p>
  
  <p>I read in the DialogPane documentation that they are planning to introduce some lightweight dialogs and even possibly InternalFrames in future releases of JavaFX, so maybe we'll just have to wait it out a little longer for this functionality.  But, ideally when opening a new Alert/Dialog it would be modal to the entire Application.</p>
  
  <p>EDIT:
  Currently doing the following for modal dialogs:</p>
  
  <pre><code>((Stage)getDialogPane().getScene().getWindow()).setAlwaysOnTop(true);
  </code></pre>
  
  <p>This makes the dialog always appear on top, however the dialog also remains on top of other applications even if our main application is minimized.  It also does not block input to any Swing components in the frame.</p>