applets states in browsers
to explain this, it's easiest to let you view my very first java applet, a simple adventure game engine:
http://213.21.66.155/Adventure/bin/bq.html
now for my problem. it does not seem to be possible to restart the applet by reloading the url.
the applet remembers it's previous state. the only way is to shut down all browser instances
and access the url again. how can i make the applet reset?
Re: applets states in browsers
What applet methods does the browser call when you reload the URL?
Add some printlns to the applet's methods to see.
Re: applets states in browsers
i just use the init() method. i know of start(),stop() and destroy() and when then are being called but never really understood
what to put in them :P
if you've got the energy you can actually see whts going on as the source is located on the web server as well:
http://213.21.66.155/Adventure/src/c...entureGUI.java
Re: applets states in browsers
Create the methods and add the printlns to see which are called.
Re: applets states in browsers
upon first url request, init() and start() are run. when i reload stop(), destroy(), init() and start() are run.
what i dont get is if init() is run on reload, how come the applet isnt restarted?
Re: applets states in browsers
You should read how browsers call applet methods:
Lesson: Java Applets (The Java™ Tutorials > Deployment)
Quote:
applet isnt restarted
Can you explain what you mean here?
Add a constructor to the applet with a println to show when it is called.
Quote:
init() is run on reload
Does your init() method completely reset everything?