This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New Window in destroy() ?

 
Jeff Vendetti
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to open a new browser window in the destroy() method of an applet? I can check to see if anything's changed, and then ask the user if they want to save, and, if so, re-open the applet to allow them to save it. Can this be done?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff,
I see 2 problems with that approach.
1. Destroy is called when the browser doesn't need your applet anymore. This is the case when the browser is closed or when the browser clears its cache. With both cases, another window will not be seen because the parent (applet or broswer) will be gone anyway.
2. Destroy is supposed to be called when the browser doesn't need an applet anymore. With browser caches, it is not exactly clear when a browser will not need an applet anymore.
The destroy method is really for an applet to clean up memory resources and kill running threads that it might have spawned, etc.
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic