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).]
posted 19 years ago
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.
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad: