title: Realtime MessageConsole GUI in Java
body: <p>I have to insert a GUI Console in my Java application.</p>
  
  <p>I have chosen <a href="http://pastebin.com/i6x34DGE" rel="nofollow">MessageConsole.java</a> class to do this.</p>
  
  <p>In my app I use this code to use the class :</p>
  
  <pre><code>logPanel = new JPanel();
      JTextArea textArea = new JTextArea (28,90);
      textArea.setEditable (false);
      textArea.setFont(new Font("Consolas", Font.PLAIN, 12));
      logPanel.add(new JScrollPane (
              textArea, 
              JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, 
              JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),
          BorderLayout.CENTER);
      MessageConsole mc = new MessageConsole(textArea);
      mc.redirectOut();
      mc.redirectErr(Color.RED, null);
      mc.setMessageLines(999);
  </code></pre>
  
  <p>Unfortunately, the doesn't work as I want. The messages lines appears when the app is in "pause" (waiting for user interaction). What I want is the lines appears one by one like the usual console, because for the moment a thousand of lines appear in the same time...</p>
  
  <p>I looked for some "delay" in the MessageConsole class, but didn't find it.</p>
  
  <p>My question is how to get my message lines in real time ?</p>
  
  <p>Thank you.</p>