public class FileRecieve implements Runnable{ }
错误:
类型 FileRecieve 必须实现继承的抽象方法 Runnable.run()public class MainFrame extends JFrame implements ActionListener
错误:
类型 MainFrame 必须实现继承的抽象方法 ActionListener.actionPerformed
 (ActionEvent)只要有写implements 就有这样的错误,这个应该怎么改?

解决方案 »

  1.   

    public class FileRecieve implements Runnable{ }
    错误:
    类型 FileRecieve 必须实现继承的抽象方法 Runnable.run()
    已解决,是因为把run写成Run了……剩下那个是为什么呢
      

  2.   

    实现了ActionListener接口就要把里面的actionPerformed(ActionEvent e){}方法实现出来。这是一个接口。你可以在actionPerformed里写事件处理方法。这是一个事件监听器接口类
      

  3.   

    我写了这样的东东的~~比如
    buttonSend.addActionListener(
         new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
         buttonSend_actionPerformed(e);
         }
         }
        );
      

  4.   

    照你这样用内部类写 就可以不写implements ActionListener了吧
      

  5.   

    luyunwind说的对,你要么象现在这样写,去掉implements ActionListener  要么,在你的类MainFrame里加个public void actionPerformed(ActionEvent e) 方法,同时去掉buttonSend.addActionListener(
         new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
         buttonSend_actionPerformed(e);
         }
         }
        );
    这些代码 ,就可以了,你自己选择
      

  6.   

    在你写的过程中是采用匿名类的方式实现了该借口,所以可以不用implements ActionListener了..
      

  7.   

    继续问一下,把implements ActionListener除掉后,变成感叹号了!
    说是serializable 类 MainFrame 未声明类型为 long 的静态终态  serialVersionUID 字段
    这又是什么原因?
      

  8.   

    继续问一下,把implements ActionListener除掉后,变成感叹号了!
    说是serializable 类 MainFrame 未声明类型为 long 的静态终态  serialVersionUID 字段
    这又是什么原因?