I have a column in a table that contains numeric values. However, some fields are empty. I want to read all fields in this column into integer variable. How should I manage empty fields?
int total = tableModel.getValueAt(currentRow, currentCol).toString().equals("") ? 0 : Integer.parseInt(tablePaxModel.getValueAt(currentRow, currentCol).toString());