frame.setDefaultCloseOperation(EXIT_ON_CLOSE);

解决方案 »

  1.   

    JFrame f = new JFrame();
    f.addWindowListener(new WindowAdapter() 
            {            
                public void windowClosing(WindowEvent e) 
                {                    
                    System.exit(0);            
                }        
            });
      

  2.   

    不是关闭windows窗口,整个系统~~不好意思  怪我没有说清楚~!~