Okay also nochmal die Gesamtsituation:
Ich habe eine Klasse und eine dazugehörige GUI.. meine eigentliches Programm. Funktioniert alles prima.. und auf diese GUI möchte ich jetzt Linien zeichnen.
Die GUI Klasse sieht wie oben erwähnt so aus:
Code:
public class GUI extends JFrame {
// Anfang Attribute
...
// Ende Attribute
public GUI() {
// Frame-Initialisierung
super("Peter");
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
int frameWidth = 549;
int frameHeight = 605;
setSize(frameWidth, frameHeight);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
int x = (d.width - getSize().width) / 2;
int y = (d.height - getSize().height) / 2;
setLocation(x, y);
Container cp = getContentPane();
cp.setLayout(null);
...
}
}
Und da drauf möchte ich nun Linien zeichnen.