0

i've following code in my program (slightly different)

for(int i = 1; i <= 100000; i++)
{
    for(int j = 1; j <= 100000; j++)
    {
        // some code here
        jtxtArea.append("some text here");
    }
}

I want to append some text in jtextarea with each iteration of inner loop. but problem is the text is appended at once when execution leaves out the loop. I want to append text as loop continues. If I use System.out.println("some text here"); instead of jtxtArea.append("some text here"); it works the way I want (text is appended to console as loops are executed). can anyone give me some clue so that I can get same effect with jtxtarea?

Zohaib Aslam
  • 585
  • 1
  • 4
  • 15
  • 1
    possible duplicate of [Dynamically refresh JTextArea as processing occurs?](http://stackoverflow.com/questions/629315/dynamically-refresh-jtextarea-as-processing-occurs) – Ascalonian Feb 04 '15 at 17:18
  • You want to run the operation in a separate thread instead of using the same thread that is running your application's messaging loop. The link provided by Ascalonian outlines how to do this. – user1274820 Feb 04 '15 at 17:48

0 Answers0