Here you can find the source of scrollToVisible(final JTable table, int rowIndex, int vColIndex)
public static void scrollToVisible(final JTable table, int rowIndex, int vColIndex)
//package com.java2s; //License from project: Open Source License import javax.swing.*; import java.awt.*; public class Main { public static void scrollToVisible(final JTable table, int rowIndex, int vColIndex) { if (table == null || !(table.getParent() instanceof JViewport)) { return; }/*from w w w . jav a 2s .c om*/ JViewport viewport = (JViewport) table.getParent(); try { final Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { table.scrollRectToVisible(rect); } }); } catch (Exception e) { } } }