Cannot make a static reference to the non-static field MySecondClass.Points

Schaaaf

Bekanntes Mitglied
Hallo,

bei mir tritt an dieser Stelle:

Java:
private void createPaintComp() {
...
 MySecondClass.Points.removeAllElements();
...
}

Java:
public class MySecondClass {
...
public Vector<Point2D.Float> Points = new Vector<Point2D.Float>();
...
}

der folgende Fehler auf :

Cannot make a static reference to the non-static field MySecondClass.Points

Allerdings ist weder doch gar nichts statisch daran...
 
ist ja auch keine statische variable....

du brauchst eine Instanz von MySecondClass um auf Points zugreifen zu koennen.

und gewoehne dir an Variablen mit Kleinbuchstaben zu beginnen, sonst blickt v.a. hier keiner durch, was nun die Klasse ist und was Variablen
 

Zurück
Oben