diff --git a/src/ExercicesTP/IHM/IHMRechercheEtudiant.java b/src/ExercicesTP/IHM/IHMRechercheEtudiant.java index 9ebad30..1874dab 100644 --- a/src/ExercicesTP/IHM/IHMRechercheEtudiant.java +++ b/src/ExercicesTP/IHM/IHMRechercheEtudiant.java @@ -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); } @@ -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()); + } + }); }