S
swing_unwissender
Gast
Hallo!
Ich hab ein kleines Problem bzw ne Frage.
Ich Hab mir mit nem Gridbaglayout ne GUI gebastelt und auch Ein Tabbedpane eingefügt, in welches ich jeweils ein neues Panel(auch GBL) mit nem Label und einem Textfeld drinnen habe. Nun positioniert er mir aber immer die Sachen mittig im Panel obwohl ich gridx & gridy=0 angebe.
Hat da jemand ne Idee dazu warum das so ist? hab mich schon mit anchor herumgespielt,hat aber nichts gebracht.
Hier mal ein kurzer Ausschnitt.
panesolid ist das panel im Tabbedpane und tptype ist der tabbedpane. cs is das constraint nur für das panel und c
hoffe mir kann da wer einen Tipp geben.
lg devil
Ich hab ein kleines Problem bzw ne Frage.
Ich Hab mir mit nem Gridbaglayout ne GUI gebastelt und auch Ein Tabbedpane eingefügt, in welches ich jeweils ein neues Panel(auch GBL) mit nem Label und einem Textfeld drinnen habe. Nun positioniert er mir aber immer die Sachen mittig im Panel obwohl ich gridx & gridy=0 angebe.
Hat da jemand ne Idee dazu warum das so ist? hab mich schon mit anchor herumgespielt,hat aber nichts gebracht.
Hier mal ein kurzer Ausschnitt.
panesolid ist das panel im Tabbedpane und tptype ist der tabbedpane. cs is das constraint nur für das panel und c
Code:
GridBagConstraints c = new GridBagConstraints();
..
..
..
panesolid.setLayout(new GridBagLayout());
GridBagConstraints cs = new GridBagConstraints();
cs.gridx = 0;
cs.gridy = 0;
panesolid.add(lblweightperpiece,cs);
cs.gridx = 1;
cs.gridy = 0;
panesolid.add(tfweightperpiece,cs);
tptype.add("Fest", panesolid);
..
..
..
..
//hier füge ich dann den tabbedpane dem frame hinzu
c.gridx = 0;
c.gridy = 3;
c.gridwidth=3;
c.gridheight=3;
getContentPane.add(tptype, c);
hoffe mir kann da wer einen Tipp geben.
lg devil