title: How do I update the input of a TextArea in real-time?
body: <p>I am currently working on a JavaFX-program with SceneBuilder which also utilies the commandline of windows. To show the user that the program is doing something I want it to put the console-output into a textarea. So far it only updates after everything is finished, not in real-time, which is my goal.</p>
  
  <p>Here is the code I have so far, where it enters "tree" as a test. "textareaOutput" is the textarea which shows the output:</p>
  
  <pre><code>try {
              Process p = Runtime.getRuntime().exec("cmd /C tree");
              BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
              String line = null;
              while ((line = in.readLine()) != null) {
                  System.out.println(line);
                  textareaOutput.appendText(line + "\n");
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I know of MessageConsole in Swing, but I don't know if something similar exists in JafaFX</p>