Search code examples
javaswingjtextarea

How to Display Output in Text Area in java


I am trying to display my output in Jtext Area.

while ((line1 = br1.readLine()) != null) {
    txt_output.append(line1+"\n");
    System.out.println(line1);
}

It gives me output once all the process finished. What want to show output execution line by line instead of all together.

please help me.....


Solution

  • One similar post in Stackoverflow, deals with concurrency using threads.

    Refer this one: Dynamically refresh JTextArea as processing occurs?