This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes New Window in destroy() ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "New Window in destroy() ? " Watch "New Window in destroy() ? " New topic

New Window in destroy() ?

Jeff Vendetti

Joined: Oct 09, 2001
Posts: 3
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

Joined: Jan 09, 2001
Posts: 1492
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.
I agree. Here's the link:
subject: New Window in destroy() ?
Similar Threads
Applet Opening new html window
For save applet window in java
File Download - any way to prevent "Open from current location"
New method for drop down menu
closing !!