Bonjour je veux afficher dans le jcombobox cmbdetail just les détails de la status sélectionné par l'admin dans le cmbstatus.J'ai essayé avec ce code mais je n'arrive pas à la solution .Just les status qui s'affiche



Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
// chargement des status:  
public void loadstatus() {
        try {
            rs = cnx.getst().executeQuery(
                    "select DISTINCT LIB_STATUS FROM APPELS");
            while (rs.next()) {
                cmbstatut.addItem(rs.getString("LIB_STATUS"));
                cmbstatut.setSelectedItem(null);
            }
            loaddetail();
 
        } catch (SQLException e) {
            // TODO Auto-generated catch block
 
        }
    }
 
// chargement des detail:
    public void loaddetail() {
        try {
            rs = cnx.getst().executeQuery(
                    "Select DISTINCT LIB_DETAIL from APPELS where LIB_STATUS='"
                            + (String) cmbstatut.getSelectedItem() + "'");
            while (rs.next()) {
                cmbdetail.addItem(rs.getString("LIB_DETAIL"));
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
        }
    }