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
| public void actionPerformed(ActionEvent arg0) {
String nom=textField.getText(),
String prenom=textField_1.getText(),
String acte=((String)comboBox.getSelectedItem()).trim();
String catégorie=ConnectionManager.getCategorie(((String)comboBox.getSelectedItem()).trim());
CardLayout cl = (CardLayout)(panel_1.getLayout());
if ( premiereFois ) {
premiereFois = false;
location = new Location();
panel_1.add(location, "1");
vente = new Vente();
panel_1.add(vente, "2");
...
obj20 = new ...
panel_1.add(obj20, "20");
}
location.setValues(nom,prenom,acte);
vente.setValues(nom,prenom,acte);
...
obj20.setValues(nom,prenom,acte);
cl.show(panel_1, catégorie);
} |
Partager