title: JavaFX : After setting text in textArea, setting scroll to bottom in separate thread is not working
body: <p>I created one JavaFX application where I'm updating log with one background process. So I'm setting log text in TextArea and setting scroll to bottom using <code>logs.setScrollTop(Double.MAX_VALUE)</code>. but scrollbar is set to little bit up from the bottom.
  I also tried TextFlow inside ScrollPan and setting scroll to bottom using <code>logDisplay.setVvalue(1.0)</code>. It is also giving the same result.</p>
  
  <pre><code>Platform.runLater(() -&gt; {
      logs.setText([setting log text]);//TextArea logs
      logs.setScrollTop(Double.MAX_VALUE));
  });
  
  //For TextFlow inside ScrollPane
  Platform.runLater(() -&gt; {
      logs.setText([setting log text]);//Text logs
      logDisplay.setVvalue(1.0);
  });
  </code></pre>
  
  <p>I also tried to run code in separate thread like</p>
  
  <pre><code>new Thread() {
      public void run(){
          System.out.println("called set test");
          logs.setText([setting log text]);//Text logs
          logDisplay.setVvalue(1.0);
      }
  }.start();
  </code></pre>
  
  <p>But nothing is working :(<br>
  Can you help me what's wrong in this?<br>
  Thanks</p>
  
  <p>--Edit--<br>
  Looks like the problem is because of threading issue. Scrollbar value is updating to the previous text value. Actually while retrieving scroll value it's not retrieving latest value but it's getting older value so scrollbar set to end of the previous message, not actual last line.</p>