void (int[] rows, boolean valueToBeSet) { List<M> changedInfo = new ArrayList<>(); for (int row : rows) { final M memberInfo = myMemberInfos.get(row); memberInfo.setChecked(valueToBeSet); changedInfo.add(memberInfo); } fireMemberInfoChange(changedInfo); final int[] selectedRows = getSelectedRows(); myTableModel.fireTableDataChanged(); final ListSelectionModel selectionModel = getSelectionModel(); for (int selectedRow : selectedRows) { selectionModel.addSelectionInterval(selectedRow, selectedRow); } }