void (final @NotNull MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { final int[] selectedRows = getSelectedRows(); if (selectedRows.length < 2) { final int row = rowAtPoint(e.getPoint()); if (row != -1) { getSelectionModel().setSelectionInterval(row, row); } } } }