Problème avec les Checkboxes
Bonjour,
J'ai une fonction pour rendre le texte d'une checkbox mais ça ne fonctionne plus.
Voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public String GetCheckBox()
{
String np = "";
try
{
JCheckBox ag = new JCheckBox();
ResultSet rs = new connexion().s.executeQuery("select * from agent");
while(rs.next())
{
ag.setText(rs.getString("specialite"));
if(ag.isSelected() == true)
{
np = ag.getText();
}
}
}
catch (SQLException ex)
{
Logger.getLogger(Classement_agentAD.class.getName()).log(Level.SEVERE, null, ex);
}
return np;
} |
Quelqu'un saurait-il m'indiquer d'où peut venir le problème ?
Merci d'avance pour votre aide.