private void setSelection(int rowAnchor, int rowLead, int colAnchor, int colLead) { setAnchor(rowAnchor, colAnchor); setLead(rowLead, colLead); table.setRowSelectionInterval( clamp(rowAnchor, 0, numUsableRows), clamp(rowLead, 0, numUsableRows)); table.setColumnSelectionInterval(colAnchor, colLead); }