因为你使用了ActionListener接口,所以要加上它的一个方法:
 public void actionEventListener() {}  你查一下它的API,好象是这个方法名,不记得了!

解决方案 »

  1.   

    继承了接口就必须实现里面的全部方法哦!ActionListener只包含actionPerformed(ActionEvent e) 一个方法,必须在你的程序里实现如:
    public void actionPerformed(ActionEvent evt) {
           // Determine which abstract button fired the 
           // event.
           AbstractButton button = (
             AbstractButton)evt.getSource();
         }
    }