public class Main { /**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
new NewJFrame( ).setVisible(true);
new NewJFrame( ).setVisible(true);
}
上面的代码是程序一运行就创建 了两个窗体 ,关闭了其中一个窗体后,整个程序就关闭了 怎么才能 关闭了其中一个窗体后,整个程序都可以继续运行
setDefaultCloseOperation(EXIT_ON_CLOSE);
找了注了试试
class MyWindow extends WindowAdapter
{
public void windowClosing(WindowEvent wevent)
{
dispose();
}
}