JTextArea won't update
Could any of you please help me with this problem: I have a JTextArea that needs to update while my program is running. The method that should do the update, looks like this:
public void alg()
{
.....
for (int t=0;t<this.nr_gen1;t++)
{
String s=new String("t= "+t+"\n");
this.jta.append(s);// jta is the JTextArea
this.jta.updateUI();
try{
Thread.currentThread().sleep(600);
} catch(Exception e){
}
}
.........
}
Well, if I call this method from main, it updates the JTextArea while the program is running. But if I call it from a button's ActionPerformed method, the JTextArea won't update and the results are displayed in the JTextArea only when the program finishes.
I would be very grateful if you could help me with this.>

