Skip to content

Commit

Permalink
added disabling and enabling buttons recherEtudiant
Browse files Browse the repository at this point in the history
  • Loading branch information
saaya-code committed Mar 27, 2024
1 parent 8409b31 commit 1787a07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ExercicesTP/IHM/IHMRechercheEtudiant.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ private void initializeComponents() {
model = new TableModelEtudiant(dao.selection(rq), dao);
jt_Etudiant.setModel(model);
sp = new JScrollPane(jt_Etudiant);
rechercheButton.setEnabled(false);
modifierButton.setEnabled(false);
supprimerButton.setEnabled(false);

}

Expand Down Expand Up @@ -186,6 +189,13 @@ private void addEventListeners() {
JOptionPane.showMessageDialog(this, "Etudiant supprimé");
clearInputs();
});
numEtdField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
rechercheButton.setEnabled(!numEtdField.getText().isEmpty());
supprimerButton.setEnabled(!numEtdField.getText().isEmpty());
modifierButton.setEnabled(!numEtdField.getText().isEmpty());
}
});

}

Expand Down

0 comments on commit 1787a07

Please sign in to comment.