Here you can find the source of fireSelectRow(final JTable table, final int row)
public static void fireSelectRow(final JTable table, final int row)
//package com.java2s; //License from project: Open Source License import java.awt.*; import javax.swing.*; public class Main { public static void fireSelectRow(final JList list, final Object value) { if (value != null) { EventQueue.invokeLater(new Runnable() { @Override//from www .j av a 2 s . c o m public void run() { list.setSelectedValue(value, true); } }); } } public static void fireSelectRow(final JList list, final int row) { EventQueue.invokeLater(new Runnable() { @Override public void run() { list.setSelectedIndex(row); } }); } public static void fireSelectRow(final JTable table, final int row) { EventQueue.invokeLater(new Runnable() { @Override public void run() { if ((row >= 0) && (row < table.getRowCount())) { table.clearSelection(); table.setRowSelectionInterval(row, row); } } }); } }