I am assuming(or this is actually the reason), You are actually having the issue with the following line:
String oldStatus = String.valueOf(table.getValueAt(rowInModel, 3));
JTable.getValueAt(row, col)
method will return the value of the cell (row, col)
by converting them to model-index where (row, col)
is view-index. Let use look into the source of JTable
class:
public Object getValueAt(int row, int column) {
return getModel().getValueAt(convertRowIndexToModel(row),
convertColumnIndexToModel(column));
}
So your passed (row, col)
to this function should belongs to the view, instead of model. In your context which is rowInTable
. The rowInModel
is already a model index as you got it from table.convertRowIndexToModel(rowInTable)
. By calling JTable.getValueAt(rowInModel, 3)
you are essentially trying to convert a model index to another model index resulting in computational error.