destroy : Java Glossary



Dispose of any behind the scenes resources this entire Applet is using (e.g. inside the native GUI (Graphic User Interface) ). This does not delete the current application object, but it does dispose of all the children. This is required because the AWT (Advanced Windowing Toolkit) garbage collection scheme only can work on its own objects, not those inside the native GUI.

After calling destroy, an Applet/JApplet object will never be reused. The Applet object as a whole will soon after be discarded. It is not clear just what you need to dispose of to ensure that discarding the Applet object suffices. Do you need to nullify the references to your Components? Do you need to remove your Listeners? Do you need to remove your Components from the contentPane? I think some experiments with a profiler would be needed to answer those questions definitively.

Oddly sometimes the entire Applet class will be reloaded and the static inits redone after a destroy.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number