Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

closing applet

 
akalanka de silva
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey everybody
if i close the html page any kind of method have to applet to execute?
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you mean "is any specific method executed when the html page is closed"?

if yes, here goes:

Life Cycle of Applet:

1. init(): called once and only once when the applet is initialized.

2. start(): called one or many times. called whenever the applet window has been restored from an minimized position, you come back to this page from some other page etc. start all animation threads etc here.

3. paint() : called after start to paint the applet.or can be called manually, normally thru a call to repaint().

4. stop() : called one or many times. called whenever the window goes out of focus, is minimized etc. stop all animation threads etc here.

5. destroy(): called once and only once. when the applet is about to be destroyed.

So, when you close the html page, first stop() and then destroy() will be called.

hope that answers your question.
 
akalanka de silva
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey this is not my problem.i want know if we close the html page any kind of method to invoke it self automatically.like starting init method
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
quoting from my earlier post:

So, when you close the html page, first stop() and then destroy() will be called.


so, like init() is called automatically while starting, destroy() is called automatically when you close the HTML page. is that your question?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic