如何关闭按钮点击小程序 [英] how to close applet on button click
本文介绍了如何关闭按钮点击小程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从code关闭小程序
我用的 System.exit(0),但它只是一堆抛出异常,并没有将其关闭。
据我所知,这是用户的责任,关闭小应用程序,但仍是有什么办法?
How to close applet from code I have used System.exit(0) but it only throws bunch of exceptions and it did not closes it. I understand that it is responsibility of the user to close applet , but still is there any way?
推荐答案
不要拨打 System.exit(0)
在一个applet 。这可能会导致浏览器被关闭。
Don't call System.exit(0)
in an applet. This can cause the browser to be closed.
有一个更好的办法是在运行应用程序中的的JFrame
和使用的 Java Web Start的来启动应用程序。
A better approach would be to run application in a JFrame
and use Java Web Start to launch the application.
这篇关于如何关闭按钮点击小程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文