system.exit(0)??
?
还有别的吗

解决方案 »

  1.   

    结束程序就是exit()如果关闭一个frame或者dialog用dispose
      

  2.   

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      

  3.   


    我有两个JFrame画面(都是继承JFrame)其中一个(主画面Main)调用另一个(次画面Manager),
    主画面调用次画面部分代码
         p = new Manager(this, c);
         p.setVisible(true);
         this.setVisible(false);
    在次画面当中是下面的代码返回主画面,为什么不用写this.setViseble(false),次画面就
    自动消失了?是因为windowClosing方法自动调用的吗?
         this.addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
    main.setVisible(true);
    }
    });
      

  4.   

    可以这样说吧,次窗口要关闭最好用System.exit(0);setViseble(false)这样的话,子窗口还在后台运行