public void refresh() { int colStart = -1; int colEnd = -1; int rowStart = -1; int rowEnd = -1; int[] cols = ex.getSelectedColumns(); if (cols.length > 0) { colStart = cols[0]; colEnd = cols[cols.length - 1]; } int[] rows = ex.getSelectedRows(); if (rows.length > 0) { rowStart = rows[0]; rowEnd = rows[rows.length - 1]; } ((CovariateEditorModel) variableScrollPane.getExTable().getModel()).refresh(); variableScrollPane.getRowNamesModel().refresh(); variableScrollPane.autoAdjustRowWidth(); if (colStart != -1 && colEnd != -1 && rowStart != -1 && rowEnd != -1) { ex.changeSelection(rowStart, colStart, false, false); ex.changeSelection(rowEnd, colEnd, false, true); } }