解决方案 »

  1.   

    用下划线标出来了,和书里是一模一样的,Eclipse提示错误如注释所述!
      

  2.   

    public void actionPerformed(ActionEvent e)  这个方法不能嵌套使用,即不能放在别的方法中!
    ActionListener listener=new ActionListener();至于这个抽象类不能实例化,我也没找到解决方法!
      

  3.   

    ActionListener listener=new ActionListener();这一行应该没分号。
      

  4.   

    为什么去了ActionListener listener=new ActionListener();后面的分号,提示还是有错?
      

  5.   

      看这一句:ActionListener listener = new ActionListener();  直接new 一个接口,编译器肯定报错。  匿名类的定义格式是这样的:Test t = new T(){//要定义的内部类};  而不是这样的:Test t = new T();{//要定义的内部类}