title: How to print A string from command prompt to a Textarea JavaFX
body: <p>I'm writing a GUI program in JavaFX, which executes a cmd command.
  now I want to print the results in a TextArea named (SitatuionTextArea),  but I can't find a way to do that, the program just freezes until it finishes the command and shows nothing in the TextArea, but it shows everything as it should in the Intellij terminal.
  this is my code:</p>
  <pre><code>            try{
              ProcessBuilder builder = new ProcessBuilder(
                      &quot;cmd.exe&quot;, &quot;/c&quot;, &quot;cd \&quot;\&quot; &amp;&amp; &quot;+command +
                      &quot;\n&quot;);
              builder.redirectErrorStream(true);
              Process p = builder.start();
              BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
              String line;
              do {
                  line = r.readLine();
                  System.out.println(line);
                  SitatuionTextArea.setText(line);
  </code></pre>
  <p>and when I replace the paramiter (line) with some String it does show it on in the TextArea, like this:</p>
  <pre><code>            SitatuionTextArea.setText(&quot;in this case it works just fine&quot;);
  </code></pre>
  <p>can it be because the parameter line is too long or because it keeps writing? (the command downloads files from the Internet, and therefore, it keeps writing and writing until it finishes so the (line) String keeps getting bigger.</p>
  <p>thank you</p>