Refraichir un jtable aprés la suppression

ikam - 20 mars 2017 à 14:28
Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 - 24 mars 2017 à 15:29
Bonjour ,
Svp j'ai besoin d'aide je sais pas ou es le problème ici et merci d'avance



int id= Integer.parseInt(tfId.getText());
try{
pdao.supprimer(id);

DefaultTableModel model = (DefaultTableModel)Home.tableau.getModel();
model.setRowCount(0);
List<Personne> tab = pdao.afficher();
Home.tranformer(tab);

ik.showMessageDialog(null,"suupression succes" , "Notification", JOptionPane.INFORMATION_MESSAGE);

}
catch(Exception ee){
ik.showMessageDialog(null,"suupression invalide", "Notification",JOptionPane.INFORMATION_MESSAGE);
}


1 réponse

Twinuts Messages postés 5375 Date d'inscription dimanche 4 mai 2003 Statut Modérateur Dernière intervention 14 juin 2023 111
24 mars 2017 à 15:29
Salut,

Il faut notifier au modèle que la table à changée (voir fireTableDataChanged ou autre)
0
Rejoignez-nous