insérer GridBagLayout dans CardLayout
ReBonjours,
Voilà mon soucis:
J'utilise CardLayout et ce dernier me demande un panel.
J'ai ma classe ClientNouveau, qui renvoie une fenetre.
Donc c'est incompatible.
Voici un peu du code pour mieux expliquer mon problème:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| public class NouveauClient extends JFrame{
JPanel panel=(JPanel)getContentPane();
GridBagLayout gbl=new GridBagLayout();
GridBagConstraints gbc1=new GridBagConstraints();
GridBagConstraints gbc2=new GridBagConstraints();
JLabel lbDenomination = new JLabel("Dénomination:");
JTextField tfDenomination = new JTextField("");
NouveauClient()
{
panel.setLayout(gbl);
gbc1.gridx=1;
gbc1.gridy=1;
gbc1.gridwidth=1;
gbc1.gridheight=1;
gbc2.gridx=2;
gbc2.gridy=1;
gbc2.gridwidth=GridBagConstraints.REMAINDER;
gbc2.gridheight=1;
add(lbDenomination,gbc1);
add(tfDenomination,gbc2);
}
} |
comment faire pour renvoyer un panel?
merci encore pour votre aide
claire