• 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic