File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Applet Sequence in Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet Sequence in Browser" Watch "Applet Sequence in Browser" New topic

Applet Sequence in Browser

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Usually as far as I know the sequence of an applet is following:
I was testing my applet on different OS like Microsoft 2000 IE 5, on XP, .NET with IE 6 and on Netscape. I found that when you close your applet, IE 6.0 just called stop, doesn't called destroy method of an applet and rest of other I mean IE 5 called Destroy method of an applet, not stop.
Why some browsers has last method stop and others have last method of destroy.
Please let me know is there any common last method of an applet which will be invoke as last method of an applet by all browsers?

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

stop() is the last method of the applet that should be called by any browser, and as far as you ( the programmer ) are concerned, it is the last method you should actually try to do anything to the applet in. destroy() is like the normal finalize()... it shouldn't be called directly, but it is called by the garbage collector. destroy() should only have code in it that releases resources that the applet holds ( files, sockets, etc. ) that the applet is holding a reference to that may not be taken care of correctly by the garbage collector. For all other purposes stop() is the last bit of code that you can run in an applet.


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: Applet Sequence in Browser
It's not a secret anymore!