The problem is that Java hasn't enough time to repaint. Try it using a
separate thread for the task. I've used SwingWorker to create a console for
the Java output and it Works.

( Sorry for my bad english, I'm spanish )

 
 
  _____  

"Hay que inventarse un sueño para que el infinito no nos haga llorar"
Anónimo 

-----Mensaje original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Salome
Harrison
Enviado el: viernes, 06 de junio de 2003 15:15
Para: [EMAIL PROTECTED]
Asunto: JTextArea problem

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

---Publicidad--------------------------------------------------------
Únete a los miles de sin pareja en Meetic... ¡te vas a enamorar!
http://www.iespana.es/_reloc/email.meetic


---Publicidad--------------------------------------------------------
Únete a los miles de sin pareja en Meetic... ¡te vas a enamorar!
http://www.iespana.es/_reloc/email.meetic

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to