title: How JavaFX application thread works?
body: <p>I have a problem with Java FX  application thread. Here is a pseudo-code:</p>
  
  <pre><code>showMenu();
  //Contoller which waits for action(pressing button)...
  showLoadingPic();
  Thread.sleep(2000);
  showMap();
  </code></pre>
  
  <p>The problem is that the sleep occurs in window which is displayed in showMenu(), showLoadingPic() is not shown at all, and at the end window in showMap() is shown.</p>
  
  <p>The scene in showLoadingPic has a progress bar which runs 2 secs which is the same time as Thread.sleep(2000). </p>
  
  <p>So it seems like javafx application thread blocks showLoadingPic() and showLoadingPic() runs at background. </p>
  
  <p>Can somebody help me to fix this??</p>
  
  <p>Thank you in advance!</p>