title: How to implement a loading screen in JavaFX when opening another application
body: <p>I am currently working on a programm where I try to open another application (such as eg Notepad) from a link. 
  As sometimes it will take some time to open that programm, I wanted to implement either a loading screen, or simply indicate the program being loaded by changing the cursorstyle, but only for the period, until the application has been launched and is running.
  Whenever I try to implement this feature the cursor is only changed after the application is already running.
  The application is launched via the following method:</p>
  
  <pre><code>public void run(String path) {
      try {
          Runtime runTime = Runtime.getRuntime();
          Process process = runTime.exec(path);
          try {
              Thread.sleep(5000);
          } catch (Exception e) {
              new Warnings().AppOpenError(dataBean.getLinkPath());
          }
          process.destroy();
          dataBean.getPrimaryStage().getScene().setCursor(Cursor.DEFAULT);
      } catch (IOException e) {
          new Warnings().ioException(e);
      }
  }
  </code></pre>
  
  <p>How can I achieve the loading bar only being shown during loadingtime of the application?</p>