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…
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
8,519 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30