I have a delete a whole checkbox that when pressed it selects all the records and when I click it, it deletes them but after deleting them the checkbox stays with the brand and I want to remove it but I do not know how to put the checkbox to its original state
My code is as follows:
public void leeRifIdentif() {
String RIF;
int cont=0;
TableModel model = datalistado.getModel();
for(int i = 0; i < model.getRowCount(); i++){
if((Boolean)model.getValueAt(i, 0) == true){
RIF=((String)model.getValueAt(i, 1));
cont++;
try{
ps =cn.prepareStatement("DELETE FROM cliente WHERE rif=?");
String rif = String.valueOf(RIF);
ps.setString(1,rif);
ps.executeUpdate();
MostrarDatos(false);
VaciarCampos();
}catch(Exception e){
System.out.println(e.getMessage());
}
}
}
}