Hi all,

Let me first tell you what I am trying to do. I want
to run a script and display the output from the script
in a JTextArea or JTextPane in real time as it comes
from the script. This is an excerpt of what I am
doing:

String output = new String();
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(someexecutable);
BufferedReader br = new BufferedReader(new
InputStreamReader(p.getInputStream()));
while((output = br.readLine()) != null) {
  output += "\n";
  System.out.println(output);
  outputTextArea.append(output);
}
br.close();

My problem is that the output in the JTextArea does
not show up until the script is finished or all the
output is done. However, the System.out is printing
the output in real time as I would like the JTextArea
to do.

What am I missing? Please help.

Thanks,
Salom

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to