当前位置: 技术问答>java相关
小小问题,老是转不过弯来!
来源: 互联网 发布时间:2015-06-28
本文导语: 声明 class DrawPanel extends Panel implements MouseListener, MouseMotionListener {.....} 以后,出错! "Applet1.java": Error #: 454 : class mousepaint.Applet1.DrawPanel should be declared abstract; it does not define method mouseExited(java.awt.event.Mous...
声明
class DrawPanel extends Panel implements MouseListener, MouseMotionListener {.....}
以后,出错!
"Applet1.java": Error #: 454 : class mousepaint.Applet1.DrawPanel should be declared abstract; it does not define method mouseExited(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener at line 86, column 3
请教大虾怎么回事啊?
class DrawPanel extends Panel implements MouseListener, MouseMotionListener {.....}
以后,出错!
"Applet1.java": Error #: 454 : class mousepaint.Applet1.DrawPanel should be declared abstract; it does not define method mouseExited(java.awt.event.MouseEvent) in interface java.awt.event.MouseListener at line 86, column 3
请教大虾怎么回事啊?
|
你的DrawPanel类实现MouseListener接口,
就必须声明这个接口那的所有方法,
哪怕你让那个方法是空的.
就必须声明这个接口那的所有方法,
哪怕你让那个方法是空的.
|
实现接口(implements xxx)就必须实现接口的所有方法!察看MouseListener,MouseMotionListener内的方法!
|
it does not define method mouseExited
|
ok
|
yes
|
同意!
书好好看看,这是很基础的东西
书好好看看,这是很基础的东西