title: Bringing a single stage to the front in windows in JavaFX
body: <p>I am trying to create a stage in JavaFX that can pop up to the front in windows, while the main stage stays minimized.</p>
  
  <p>This only works however, when the main stage is visible on the screen. I have tried making it work using Modality, but then the user can't interact with the main stage, which is not what i want.</p>
  
  <p>The problem can be reproduced with the following Application:</p>
  
  <pre><code>public class MainApp extends Application {
  
  @Override
  public void start(Stage stage) throws Exception {
      Scene mainScene = new Scene(new Parent() {});
      Stage mainStage = new Stage();
      mainStage.setScene(mainScene);
      mainStage.show();
      mainStage.setIconified(true);
  
      Scene popUpScene = new Scene(new Parent() {});
      Stage popUpStage = new Stage();
      popUpStage.setScene(popUpScene);
  
      Thread.sleep(5000);
      popUp(popUpStage);
  }
  
  public static void popUp(Stage popUpStage){
      if (popUpStage.isIconified()) popUpStage.setIconified(false);
      popUpStage.show();
      popUpStage.requestFocus();
      popUpStage.toFront();       
  }
  </code></pre>
  
  <p>}   </p>
  
  <p>Is there anyone who has an answer to this problem?</p>