Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the destroy() functionality of an Applet in browser  RSS feed

 
Raukutam Sandeep
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to notice that the applet has been destroyed, while the browser window is opened?
I have a button in a applet window, and if I write System.exit(0) in its actionperformed method, will it work?
I wrote destroy() in the button's actionperformed method, but i'm unable notice any change in the applet's state.
Please throw some light on this.
regds,
Sandeep
 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well,
use the following code and enable the java console in the web browser . you can see the destroy method being called moment the applet is removed from the memory ie u go to some other site.public void destroy()
{
System.out.println("window destroy");
}

------------------
Sandeep Jain
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!