不会啊
我在jcreator里运行蛮好啊
看不出什么

解决方案 »

  1.   

    class ExitWindow extends WindowAdapter {
    public void WindwClosing(WindowEvent e) {
    System.exit(0);
    }
    }
    改成内部类
      

  2.   

    class ExitWindow extends WindowAdapter {
    public void WindowClosing(WindowEvent e) {
    System.exit(0);
    }
    }
      

  3.   

    windowClosing,注意头字母w是小写的哦~
      

  4.   

    现在程序改成这样子了,是把原来的“WindwClosing”改为“windowClosing”/*ExitFrame.java
      练习使用Frame,Listener
      */
        
    import javax.swing.JFrame;
    import java.awt.event.*;class ExitWindow extends WindowAdapter {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    }
    }public class ExitFrame extends JFrame {
    public ExitFrame() {
    super("Frame Title");
    setSize(300, 100);
    ExitWindow exit = new ExitWindow();
    addWindowListener(exit);
    setVisible(true);
    }//Constructor

    public static void main(String[] args) {
    ExitFrame sf = new ExitFrame();
    }//end main
    }现在编译运行都没问题了。但我想练习一下使用内部类,大侠帮忙改一下好吗?谢拉!