试试把消息的Listener动作改成这个
System.exit(0);

解决方案 »

  1.   

    退出系统用System.exit(0);
    如果仅仅是关闭当前frame用直接写dispose();就可以了。
      

  2.   

    在按钮的aactionPerformed(ActionEvent e)中
    写上System.exit(0);就ok了
      

  3.   

    我关闭当前frame,但这样做还是不对。
    能否帮我分析以上代码,错在何处
      

  4.   

    如果你有JBuilder,你可以新建一个工程。
    然后再建一个Frame包含About Dialog,在About Dialog的代码里有你想要的。
    protected void processWindowEvent(WindowEvent e) {
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          cancel();
        }
        super.processWindowEvent(e);
      }
      /**Close the dialog*/
      void cancel() {
        dispose();
      }
      /**Close the dialog on a button event*/
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == button1) {
          cancel();
        }
      }
      

  5.   

    其实dispose 只是将窗口断开连接,但是不能真正的关闭它。
    它仍然是存在的。