都是同名的??
一个actionperform就行了。

解决方案 »

  1.   

    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    要执行ActionListener接口public void actionPerform(ActionEvent arg0){
    arg0.getActionCommand();//通过这个。。
    }
      

  2.   

    如果我说的不错的话,你的类要实现ActionListener接口才行,一般我们是这样写的.
      b1=new Button("Start");
      b1.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
      try {
    start();
      }
      catch (Exception ex) {
      }
    }
      });
    这是使用匿名类写的,你可以将事件的响应单独写一个实现ActionListener接口的类,也可以直接在主类中实现ActionListener接口,象你的程序中的一样,此时的类使用this代称.
      

  3.   

    addActionListener(this);中this即传递了本身指针,
    在Listner中调用this中的一个函数即可,
    eg:
      ClassName *pAdaptee = this_point;
      pAdaptee->Fuc();
      

  4.   

    你也可以这样只写一个函数:)
    public void actionPerformed(ActionEvent e){
    if(e.getsource == button1){
                  ……
                  }else if(e.getsource==button2){
                    ……
                  }else if(e.getsource==button3){
                   ……
                  }else{
                    ……
                 }
    }