Java JTable Row Selection moveRowSelection(JTable pJTable, int pRow)

Here you can find the source of moveRowSelection(JTable pJTable, int pRow)

Description

move Row Selection

License

Open Source License

Declaration

public static void moveRowSelection(JTable pJTable, int pRow) 

Method Source Code

//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);
    }
}

Related

  1. fireSelectRow(final JTable table, final int row)
  2. getSelectedModelRow(JTable table)
  3. removeSelectedRowFromTable(JTable table)
  4. selectClickedRow(final JTable table, final MouseEvent event)
  5. selectLastTableRow(JTable table)
  6. setTableSelectedRows(JTable table, int... selectedRows)