Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server + Swing (Append incoming messages to JTextArea Failure).

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I get this to work? I want to append the incoming message to a JTextArea. It prints to the system, but won't append to the JTextArea... Is there a way to get this to work?
Thanks,
cc11rocks
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It prints to the system, but won't append to the JTextArea

What happens? Exception? Error?
 
Rob Camick
Ranch Hand
Posts: 2612
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on the lack of information provided with the question all I can do is make a wild guess.

Don't talk to the server on the EDT. See: Concurrency in Swing for an explanation and solution.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was some problem with Swing and Threads. I fixed it. I don't totally know what I did wrong in the first place, but it's working 100% now.
Thanks,
cc11rocks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic