SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
richard rehl wrote:What a difference a night's sleep makes! I decided to move on to the second exercise, a true spiral, and after solving that, tackled the Thread.sleep() thing again, and got it to work. Please feel free to critique my code!
pete stein wrote:
You still need to read the article linked to above about Concurrency in Swing since you're still calling Thread.sleep on the EDT. Myself, I wouldn't use Thread.sleep or a background thread (at least not directly), but instead would use a Swing Timer.
Ernest Friedman-Hill wrote:No, he's sleeping in main(), which is serving as the animation thread. SwingTimer is an option, but what he's doing here is perfectly fine.