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 31 32 33 34 35
|
private JButton getBtnAffiche() {
if (btnAffiche == null) {
btnAffiche = new JButton();
btnAffiche.setBounds(new Rectangle(282, 30, 44, 23));
btnAffiche.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Object Nom=cbxClients.getSelectedItem();
String prenom=null;
String adresse1=null;
String adresse2=null;
String codePostal=null;
String commune=null;
String tel=null;
Client nomRecherche=new Client((String)Nom,prenom,
adresse1,adresse2,codePostal,commune,tel);
try
{
ConnexionEncapsulee connecteur = new ConnexionEncapsulee();
nomRecherche.Rechercher(connecteur);
txtNomClient.setText((String)(Nom));
txtPrenomClient.setText(prenom);
txtAdresse1Client.setText(adresse1);
}
catch(SQLException ex)
{
JOptionPane.showMessageDialog(null,
"Erreur JDBC : "+ex.getMessage());
}
}
});
}
return btnAffiche; |
Partager