Close event for applet?

ε祈祈猫儿з 提交于 2019-12-11 03:28:13

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11516744/close-event-for-applet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!