[英]how to close jframe besides setvisible
i want to calling form2 from form1 using command new form2().show, this.setVisible(false). 我想使用命令new form2()。show,this.setVisible(false)从form1调用form2。 I want to ask how to close form1 without using setvisible().
我想问一下如何在不使用setvisible()的情况下关闭form1。 because setVisible only hide it but did not close the program
因为setVisible仅隐藏它,但没有关闭程序
-使form2可见时,可以使用setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
方法关闭form1。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.