Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applet stop() and destroy functions() never called

Status
Not open for further replies.

davidchardonnet

Programmer
Mar 21, 2001
167
FR
Hello,

I have an applet which uses 4 threads. And every time I reload it by pressing Ctrl+F5 (in IE 5) my applet creates 4 new threads and does not destroy the ones that were created by the last applet.

I used the stop() and destroy() functions to do this, but these functions are never called in IE 5 or Netscape 6.2(I saw this by putting some logs into the Java console).

Does anybody know how to destroy these threads?

Thank you

David
 
when your applet is loaded, the init method is called. check if the threads are running before you create new threads ie myThread.isAlive()

or destroy the thread before creating it. do this by having a boolean member variable in your thread class. check when this is true to stop your thread
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top