if you use
((DefaultTableModel)table.getModel()).removeRow(i);
, the total row count will be changed. so you have to modify the count value:
int b = table.getRowCount();
System.out.println("row count" + b);
for (int i = 0; i <b;) {
try
{
String str = (String) table.getModel().getValueAt(i, 3);
String str1 = (String) table.getModel().getValueAt(i, 5);
if (!(str1 == null)) {
((DefaultTableModel)table.getModel()).removeRow(i);
b -= 1;
table.repaint();
System.out.println("remove row no is"+i);
}
}
else {
i++;
}
catch(ArrayIndexOutOfBoundsException e)
{System.out.println("array index out of bound exception"+e);
}
}