public class ThreeListener implements MouseMotionListener,MouseListener,WindowListener{...}
编译时提示我“ThreeListener is not abstract and does not override abstract method windowDeiconified(java.awt.event.WindowEvent) in java.awt.event.WindowListener”
请问这是为什么?谢谢

解决方案 »

  1.   

    在java.awt.event.WindowListener接口中,定义windowDeiconified(java.awt.event.WindowEvent)这个方法,但是你自己写的类ThreeListener没有实现这个接口定义的方法,而你有没有声明你自己的类是abstract抽象类。
      

  2.   

    windowDeiconified(java.awt.event.WindowEvent)
    是java.awt.event.WindowListener里的抽象方法,
    你的类实现了这个接口就必须要覆写这个方法.
      

  3.   

    once your class "implements" an interface, you MUST provide the implementations of all the methods defined the interface except for that your class is abstract.you have said that your class (non-static) implemented 3 interfaces, MouseMotionListener, MouseListener and WindowListener, so check the Java-doc for the above interfaces and find what methods are defined in them. Redefine all of them in your class so that your code satisfies the compiler.