Solved

destroying a Frame, from an applet

Posted on 1998-02-17
4
281 Views
Last Modified: 2010-04-16
I have a problem where my applet calls up a Frame, but for some reason destroy() (or i'm writing it wrong) never seems to get called, until Netscape is shut down.  So as you surf around, it's still there taking up resources, etc.  

What will cause the applet's destroy() method to be called?

How do I remove the Frame object?

i'm using 1.0.2 by the way.  thanks
0
Comment
Question by:glow060197
  • 2
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1233120
As far as Netscape is concerned, the destroy() method doesn't need to be called until the object is to be cleaned up.  That will certainly occur when the browser is terminated.  You can try and force the JRE engine to clean up by setting your Frame's class variable to null.

Frame myframe;

// Do stuff here...

// Done with it
myframe = null;

It should do the trick (eventually) but there is no guarantee in all environments.
0
 

Author Comment

by:glow060197
ID: 1233121
I tried myframe=null; already (in destroy() at least).  You know how (under win95) the Frames have little X in upper right?  Well that box won't kill it either.  I've created a super-frame somehow...  Maybe an event-handling trick can be hacked?
0
 
LVL 3

Accepted Solution

by:
gwalters earned 70 total points
ID: 1233122
The X won't kill the frame unless you process Event.WINDOW_DESTROY (which is what you get when they click there).

myframe=null; does absolutely nothing.  You don't have to have a reference to a frame for it to be visible.  Don't beleive me?  Try: (new Frame()).show();



To get rid of it:

myframe.hide();
myframe.dispose();

0
 
LVL 3

Expert Comment

by:gwalters
ID: 1233123
BTW, put that in your applet's stop() method and it will go away when they leave your page (I assume that's where you were putting the destroy()).
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
splitOdd10 challenge 5 109
map related example 6 49
windows explorer path to command prompt 5 46
Oracle SQL syntax check  without executing 6 57
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question