Here you can find the source of moveRowSelection(JTable pJTable, int pRow)
public static void moveRowSelection(JTable pJTable, int pRow)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import java.awt.*; public class Main { public static void moveRowSelection(JTable pJTable, int pRow) { Rectangle rect = pJTable.getCellRect(pRow, 0, true); pJTable.scrollRectToVisible(rect); pJTable.clearSelection();//from ww w . j a va 2s .c om pJTable.setRowSelectionInterval(pRow, pRow); } }