I am new to Java (actually spending three days), but I have to write my own cross-platform editor application as an interface to my database. Actually everything is working fine, but I have a weird package error. inb4 3 years of Python and AS3 programming.
I am trying to extend java.util.ArrayList and hit the override of the add method . The code looks something like this:
package myxmleditor;
public class BarsList<EditorXMLObject> extends
java.util.ArrayList<EditorXMLObject> {
@Override
public boolean add(EditorXMLObject element) {
editorGUI.addEditorPane(element);
return super.add(element);
}
public EditorGUIInterface editorGUI = null;
}
BarsList , EditorGUIInterface and EditorXMLObject are in the myxmleditor package . AddEditorPane Method -
EditorGUIInterface.addEditorPane(EditorXMLObject element)
NetBeans shows me an error:
method addEditorPane in class myxmleditor.TsukasaXMLEditGUI cannot be applied to given types;
required: **myxmleditor.EditorXMLObject**
found: **EditorXMLObject**
reason: actual argument EditorXMLObject cannot be converted to myxmleditor.EditorXMLObject by method invocation conversion
source
share