1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
GridBagLayout l = new GridBagLayout();
getContentPane().setLayout(l);
GridBagConstraints c = new GridBagConstraints
(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new Insets(10, 10, 10, 10), 0, 0);
l.setConstraints(MonJLabel, c);
getContentPane().add(MonJLabel);
c.gridx = 0;
c.gridy = 1;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.NONE;
c.weightx = 0;
c.weighty = 0;
l.setConstraints(bouton1, c);
getContentPane().add(bouton1); |
Partager