title: JavaFX update textArea
body: <p>I have a simple JavaFX application which has a TextArea. I can update the content of the textArea with the code below inside the start() method:</p>
  
  <pre><code>new Thread(new Runnable() {
  
      public void run() {
  
          for (int i = 0; i &lt; 2000; i++) { 
  
              Platform.runLater(new Runnable() {
                  public void run() {
                      txtarea.appendText("text\n");
                  }
              });
          }
      }
  }).start();
  </code></pre>
  
  <p>The code just write the <code>text</code> string into the TextArea 2000 times. I want to update this textArea from a function which is implemented outside of the start() method.</p>
  
  <pre><code>public void appendText(String p){
      txtarea.appendText(p);
  }
  </code></pre>
  
  <p>This function can be called from arbitrary programs which use the JavaFX application to update the TextArea. How can I do this inside the appendText function?</p>