public void setSelectionInterval(int anchor, int lead) { super.setSelectionInterval(anchor, lead); int min = Math.min(anchor, lead); int max = Math.max(anchor, lead); // Table may be showing 0 bytes, but we're showing 1 row header if (max < table.getRowCount()) { table.setSelectedRows(min, max); } }
private void syncRowCount() { if (table.getRowCount() != model.getSize()) { // Always keep 1 row, even if showing 0 bytes in editor model.setSize(Math.max(1, table.getRowCount())); } }