Close event for applet?

I have a JApplet that adds a JPanel. I play some music in this, but when I close the web browser Java is still running and playing music.

I couldn't find anything on this, but is there a way to override or catch the close event? I'd like to do a music.stop() or other such housecleaning to try and to get it to shutdown in a more graceful manner.

Answers


void destroy()

Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated.

void stop()

Called by the browser or applet viewer to inform this applet that it should stop its execution.


Need Your Help

How to safelycompare UTF-8 to ISO 8859-1 (latin1) in PHP?

php character-encoding

This might be a stupid question, but nothing seems to be working for me: