How to close java Applet through code

后端 未结 4 1931
失恋的感觉
失恋的感觉 2021-01-22 02:52

I am developing a java applet. I want it to be closed by the code. I have used System.Exit(0) but it is not working. Is there any other method to achieve this?

4条回答
  •  花落未央
    2021-01-22 03:16

    An applet cannot call System.exit(int);. Security permissions don't let an applet do this. And if you are trying to close the browser window, even if you signed the code and the browser/user trusted you, the browser wouldn't let you shutdown/close the browser window.

    If all you want to do is close a Window/Frame created from the applet, this is no different than closing a window outside of an applet.

提交回复
热议问题