Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

System.exit(0) in destroy()

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Getting a problem. Usually in destroy() method, we people free all the resources that were in use by the applet and then closes the JVM by calling System.exit(0). But then, its raising a security exception ??
If I dont call System.exit(0), then there is no exception, but I have several threads running in applet, so in destroy I wanna kill the thread.
Consider this :
I have a chat applet running. Now for every user that connects to the chat applet, the applet creates a new thread. When one of the client wishes to leave the chat applet, I wanna kill the thread for that particular client. How this is going to achieve. Kindly help. !!!
Regards & all the best,
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in your destory method of applet just check if the running thread is not null and then just set it to nul it's a nice way to do it. It will kill your thread.
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!