This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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
Author

Applet Sequence in Browser

Angela Jessi
Ranch Hand

Joined: Nov 27, 2000
Posts: 428
Hi,
Usually as far as I know the sequence of an applet is following:
init()
Start()
Paint()
Run()
Stop()
Destroy()
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?
Thanks,
Angela

Nathan Pruett
Bartender

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.

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet Sequence in Browser