Hello,
I'm having some strange problems with an applet I wrote. The first time
I launch the applet from a browser all is well. If I quit the applet
and then restart it though some of my variables keep the values they
were assigned in the previous run. This only happens if I use the same
browser window and do not exit the JRE. It's like --
open browser --> open applet --> change setting --> close applet -->
open applet and the setting is changed.
If I close the browser (and thus the JRE) between runs then all is
reset.
Why are variables being saved even after I quit the applet?
Mickey Segal - 22 Mar 2006 03:58 GMT
> Why are variables being saved even after I quit the applet?
Static variables are saved as long as the browser stays open. You need to
explicitly reset static variables if you want them reset. Similarly, the
saved information can be useful in other situations.
Roedy Green - 22 Mar 2006 04:32 GMT
>Why are variables being saved even after I quit the applet?
static or instance variables?

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Chris Smith - 22 Mar 2006 06:46 GMT
> I'm having some strange problems with an applet I wrote. The first time
> I launch the applet from a browser all is well. If I quit the applet
> and then restart it though some of my variables keep the values they
> were assigned in the previous run.
What do you mean by "quit the applet"? There is no defined way to quit
an applet. An applet has no way of expressing a desire to be "quit."
If you leave a page that has an applet on it, the normal thing thing
that will occur is that stop() will be called, and then start() will be
called when you return to that page. This prevents a bunch of shutdowns
and startups of the VM in a single web site. destroy() is called at
some unspecified time if the browser wants to shut down the applet, but
there is no way for an applet to specifically request that the browser
do that.
Ultimately, you are responsible for performing any initialization in
start() and stop(), or providing the user an explicit means of resetting
the applet to its original state (for example, and button or menu item).

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation