0
我需要关闭我的应用程序当前窗口,而不关闭整个应用程序我的代码如下,以设置窗口可见,但它关闭所有窗口,当我点击时,当前打开的任何窗口右上角的红色十字按键关闭jframes当前窗口,而不是整个应用程序
private void lb_helpMouseClicked(java.awt.event.MouseEvent evt) {
new Reports().setVisible(true);
}
private void lb_certMouseClicked(java.awt.event.MouseEvent evt) {
new ChooseCert().setVisible(true);
}
private void lb_reportMouseClicked(java.awt.event.MouseEvent evt) {
new Reports().setVisible(true);
}
Try frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); –
听起来像EXIT_ON_CLOSE是问题,而不是解决方案。将任何将默认关闭操作设置为EXIT_ON_CLOSE的行更改为使用DISPOSE_ON_CLOSE。 – VGR