1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
private int row;
private JTable table;
public void setRow(int row){this.row = row;}
public void setTable(JTable table){this.table = table;}
public void actionPerformed(ActionEvent event) {
JOptionPane jop = new JOptionPane();
int option = jop.showConfirmDialog(null, "Voulez-vous supprimer les informations ?", "Effacer les données", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if(option == JOptionPane.OK_OPTION)
{
if(table.getRowCount() > 0){
((TableauXML) table.getModel()).removeRow(this.row);
}
}
} |
Partager