1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public EcoleCreator() {
setTitle("Ajout d'une école");
setSize(320,250);
setLocationRelativeTo(getParent());
Container pane = getContentPane();
JLabel label;
JTextField nom,adresse,num;
pane.setLayout(new GridBagLayout());
label1 = new JLabel("Nom: ");
nom = new JTextField(10);
label2 = new JLabel("Rue :");
adresse = new JTextField(10);
pane.add(label1, new GridBagConstraints(0,0,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0));
pane.add(nom, new GridBagConstraints(1,0,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0));
pane.add(label2, new GridBagConstraints(0,1,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0));
pane.add(adresse, new GridBagConstraints(1,1,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0));
setVisible(true);
} |
Partager