jFrame.dispose()继承自java.awt.window类养成常查api文档的好习惯:)

解决方案 »

  1.   

    setDefaultCloseOperation(.JFrame.EXIT_ON_CLOSE)
      

  2.   

    jdk1.2:
      public static void setupClosing(JFrame frame) {  
    frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }
        });
    The improved solution in JDK 1.3:
    frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
      }
      

  3.   

    tDefaultCloseOperation(this.HIDE_ON_CLOSE);
    this.setvisible(false));
      

  4.   

    不好意思写错了,是setDefaultCloseOperation(this.HIDE_ON_CLOSE);
    this.setvisible(false));这样就可以从内存中卸掉了。