Forum Stats

  • 3,839,016 Users
  • 2,262,438 Discussions
  • 7,900,836 Comments

Discussions

JApplet's stop() not called

882296
882296 Member Posts: 4
edited Sep 28, 2011 10:27PM in Java Applet Development
Hi All,

My JApplet's stop() method is not called from IE, Chrome or Safari when I switch tabs, but is called along with the destroy() method when I close the tab that includes the applet.

Could you please let me know why this behavior occurs? In the tutorials, it is mentioned that stop() will be called to release resources when the user is not viewing the applet (hence when he/she switches tabs) and I need it for the applet.

Any links or workarounds are very welcome. Thank you.

Kind Regards,
S. Gokhan Topcu
Tagged:

Answers

  • EJP
    EJP Member Posts: 32,920 Gold Crown
    edited Sep 28, 2011 10:27PM
    In the tutorials, it is mentioned that stop() will be called to release resources when the user is not viewing the applet (hence when he/she switches tabs) and I need it for the applet.
    No, that isn't mentioned at all.

    What it actually says is this: 'When the user leaves the page, for example, to go to another page, the browser stops and destroys the applet.'

    That's not the same thing as 'when the user is not viewing the applet', by a long shot.

    In the Javadoc for stop() it says 'It is called when the Web page that contains this applet has been replaced by another page, [my emphasis] and also just before the applet is to be destroyed.'
This discussion has been closed.