This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Program becomes unresponsive after using while loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Program becomes unresponsive after using while loop" Watch "Program becomes unresponsive after using while loop" New topic
Author

Program becomes unresponsive after using while loop

Frederick Pease
Greenhorn

Joined: Aug 12, 2013
Posts: 3
I'm not sure what's making this happen, but something tells me it has to do with the loop. I hit the enter key which starts the program, then it doesn't stop when I press the button again.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20078
    
  30

Please read Concurrency in Swing. In short, this loop takes over the Event Dispatcher Thread completely.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
Have you checked out Aspose?
 
subject: Program becomes unresponsive after using while loop
 
It's not a secret anymore!