F
Flyer
Gast
ich habe folgendes layout! es sind alles Label im GradbagLayout!
in die Label mit l_show... wird im späteren verlauf ein wert gesetzt der sich immer verändert! je nach länge dieses wertes verschiebt sich das ganze layout! wie kann ich das unterbinden?
in die Label mit l_show... wird im späteren verlauf ein wert gesetzt der sich immer verändert! je nach länge dieses wertes verschiebt sich das ganze layout! wie kann ich das unterbinden?
Code:
public Konstruktor()
{
addComponentToLayout(l_name,0,1,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,5,0),75,0);
addComponentToLayout(l_showname,1,1,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,5,0),75,0);
addComponentToLayout(l_gpnr,0,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showgpnr,1,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_admnr,0,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showadmnr,1,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_von,2,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showvon,3,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_bis,2,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showbis,3,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_oezult,4,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showoezult,5,2,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_lttyp,4,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(l_showlttyp,5,3,GridBagConstraints.NONE,GridBagConstraints.WEST,1,1,new Insets(0,0,1,0),75,0);
addComponentToLayout(b_open,1,5,GridBagConstraints.NONE,GridBagConstraints.WEST,3,1,new Insets(0,0,0,0),0,0);
b_open.addActionListener(this);
}
public void addComponentToLayout(Component comp,int gridx, int gridy, int fill, int anchor, int gridwidth, int
gridheight, Insets insets, int ipadx, int ipady)
{
gbc.gridx = gridx;
gbc.gridy = gridy;
gbc.fill = fill;
gbc.anchor = anchor;
gbc.gridwidth = gridwidth;
gbc.gridheight = gridheight;
gbc.insets = insets;
gbc.ipadx = ipadx;
gbc.ipady = ipady;
gbc.weightx = 100;
gbc.weighty = 100;
gridBagLayout.setConstraints(comp, gbc);
}