无法覆盖dragfinished方法

时间:2016-08-01 22:34:03

标签: codenameone

我有一个Button类的子类,我想覆盖Component类的dragFinished方法。但是,当我尝试这样做时:

@Override
protected void dragFinished(int x, int y){
    // other code here
}

我收到错误:method does not override or implement a method from a supertype

此外,如果这提供了更多信息,当我尝试在方法中调用super.dragFinished(x, y)时,我收到此错误:dragFinished(int,int) is not public in Component; cannot be accessed from outside package.

任何帮助将不胜感激。谢谢!

1 个答案:

答案 0 :(得分:0)

您的IDE是否可能从错误的类中自动完成继承,例如java.awt.Button代替com.codename1.ui.Button