title: How do I make my for loop delay for 1 second between iterations on JFrame?
body: <p>This is my function so far:</p>
  <pre><code>    public void slow_print(final String s, int interval){
          for (int i=0; i&lt;s.length(); i++){
              txta_main.setText(
                  txta_main.getText()
                  + String.valueOf(s.charAt(i))
              );
          }
      }
  </code></pre>
  <p>I don't know how to make it wait in between <code>setText</code> calls. I can't use <code>Thread.sleep</code> as this is on a GUI and the sleep freezes the output until the whole string is done.</p>