JFrame frame = new JFrame();
......给他提供一个啥也不做的空关闭事件响应函数就可以了。当然,也可以不是空的,比如跳出个美女图片,总之不要调用一些关闭程序的函数就可以了。frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {}
});

解决方案 »

  1.   

    还有,你不能再调用setDefaultCloseOperation函数,否则偶的那个就失效了。
      

  2.   

    你自己拿去试试能不能用“关闭”按钮关掉窗口。================ test.java =====================
    import javax.swing.*;
    import java.awt.event.*;public class test extends JFrame {
        public test() {
            this.addWindowListener(new WindowAdapter() {  //添加窗口关闭事件
                public void windowClosing(WindowEvent e) {
                 ///// Nothing /////
                }
            });
            
        this.setSize(350,250);
        this.show();
    }

        public static void main(String[] args) {
            new test();
        }
    }
      

  3.   

    to:   batfree(没有计算机的程序员) 能帮我找一下么, 给几个关键词也可以