title: How to make JavaFX thread-safe with Platform.runLater
body: <p>I'm making a JavaFX application in which I read a problem and generate a solution when the start button is pressed. The problem is that when I click the start button, the GUI hangs. I looked at <a href="https://stackoverflow.com/questions/13784333/platform-runlater-and-task-javafx">this post</a> which suggests to wrap the thread-safe method in Platform.Runlater. </p>
  
  <p>Now when the button is clicked, the method doBtnStartPressed() in my controller is called. This method only contains the call to the showSolution() method. Then I wrapped the content of this method in the Platform.runLater as follows:</p>
  
  <pre><code>private void showSolution() {
      Platform.runLater(new Runnable() {
          public void run() {
             // solve problem
             // draw solution on panes (rectangles which represent time windows)
          }
      });
  }
  </code></pre>
  
  <p>This however doesn't work.</p>