We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,153 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion
So I have the code below. The whole program just reads from a text file and prints certain characters if it detects specific characters from the text file (in this case I just made it mimics what the text file has). My text file contains this: .........www... bbb..........ww ...bb....ww.... The…

Ya, I tried to use append also but I just found out the real problem. When the console is in use, the GUI freezes. Has to do with threading or something. The GUI always wait for the console thread to finish before it becomes accessible again.

serph09
Light Poster
46 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

It's nothing to do with the console as such, it just depends which thread you are doing your console output on.
Swing uses a single thread (called the "Swing Thread", "Event Dispatch Thread" or "EDT") for everything it does, including screen updates, mouse/keyboard handling, and calling your paint and actionPeformed methods. If you have code in any methods like those that loops and runs for any appreciable time, then everything else in Swing's queue just gets held up until you have finished.
That's why earlier I asked about how you will approach controlling the animation speed/timing - doing it in a loop is going to cause these kinds of problems.

JamesCherrill
... trying to help
Moderator
8,519 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0672 seconds using 2.68MB