解决方案 »

  1.   

    既然实现了接口ActionListener,为什么还会报错,this指的到底是什么对象
      

  2.   

    this是指代码被执行时的本类当前对象(ButtonDemo)
      

  3.   

    this是指代码被执行时的本类当前对象(ButtonDemo)
      

  4.   

    提示信息是这个The method ActionListener(ActionListener)in the type AbstractButton is not applicable for the arguements(ButtonDemo)不明白说的是什么意思
      

  5.   

    建议在用addActionListener()方法时用内名内部类的方法实现actionPerformed()方法
    jbtStart.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
    thread.start();
    jbtStart.setEnabled(false);
    }
    });
      

  6.   

    哦明白你意思了 参数类型ActionListener是一个接口类型,但是实参this的类ButtonDemo也是实现了ActionListener这个接口的,因此它就是这种接口类型 
      

  7.   

    The method ActionListener(ActionListener)in the type AbstractButton is not applicable for the arguements(ButtonDemo)不明白说的是什么意思 根据你的报错,我怀疑ButtonDemo类实现的ActionListener接口不是java.awt.event.ActionListener,而是一个自定义的重名类根据两点推测
    ActionPerformed方法实现了接口中方法
    ButtonDemo有黄色警告