title: Why is my JTextArea not updating?
body: <p>I have code  as follows:</p>
  
  <pre><code>class SimplifiedClass extends JApplet {
  
      private JTextArea outputText;
      // Lots of methods
      public void DoEverything() {
          String output = "";
          for(int i = 0; i &lt;= 10; i++) {
              output += TaskObject.someLongTask(i);
              outputText.setText(output);
          }
      }
  }
  </code></pre>
  
  <p>However, instead of updating the text area after each iteration of the loop when setText is called, it appears to only update the text when all the runs of the task are done. Why does this happen, and how can I resolve it?</p>