JTextArea hangs .... plz help

i have made a gui using jframe(prog1.java). there is a JTextArea which is used for printing output. i have another class(prog2.java) which does all the computation and prints any output to the above JTextArea.

what i am doing is ... first prog1 is executed and in that a thread is created which executes prog2. now if prog2 goes into infinite loop, it keeps callingappend() method to append output to JTextArea of prog1. but due to this infinite loop, prog1 or the GUI hangs, and i am not able to click any menu button that i have made or do anything else in the gui.

can anyone suggest some solution to overcome this.

it is urgent :(

tia

[678 byte] By [mynameisanuraga] at [2007-11-27 8:43:11]
# 1
> which does all the computation do this in a separate thread, and when the textArea needs to be updated,wrap the append() in a SwingUtilities.invokeLater()
Michael_Dunna at 2007-7-12 20:42:45 > top of Java-index,Desktop,Core GUI APIs...