@Override public void setValueAt(Object value, int row, int col) { switch (col) { case 0: sortedElements.get(row).setStatus((Status) value); try { model.saveStatusFile(); } catch (IOException e) { JOptionPane.showMessageDialog(null, "Error saving status file: " + e); } model.fireCourseStatusChanged(selected); break; case 2: sortedElements.get(row).setDuration((Integer) value); saveModelAndInform(); break; default: throw new RuntimeException("Column " + col + " should not be editable"); } }