Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Updating JTextArea with process status  RSS feed

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a program that automates the build.xml process. In it is a JTestArea
that I want to put the output of the build along with some other process
messages. The problem is the JTextArea is not updated until the end of the
process and by that time it is meaningless. I tried using SwingUtilities.invokeLater to update it but that didn't solve the problem.

Thanks.
 
Joe Ess
Bartender
Posts: 9428
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SwingUtilities.invokeLater still runs the logic on the Swing Event thread, so your GUI can't be updated. You need a thread of your own Have a look at this topic in the FAQ. It explains what's going on, how to fix it and links to other resources.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!