This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi Ash, Instead of using for loops to wait why not just use the Thread.sleep(...) method. You can place it inside a try/catch block so that you can catch the InterruptedException and exit cleanly. That might stop your major delay ...
Hi Manfred, According to your suggestion i replace the code with try catch block but when i click on close icon applet still hangs. Can you tell me what's wrong? Thanks, Ash [This message has been edited by Cindy Glass (edited August 21, 2001).]
Joined: Jan 09, 2001
Hi Ash, Your problem might not have been the for loops after all ... When I run your code I noticed that your while loop is chugging away filling in the event queue with drawing commands. When you hit stop your quit event is placed in the queue. Unfortunatly it has to wait until all the drawing commands are completed first. I think each drawing command might be starting up a new drawing thread which is why the while loop can continue to chug even though the drawing is not being completed. I am drawing a blank right now on how to fix the problem though ... Sorry, Manfred.