Java JTable Row getRealRowPos(int rowPos, JTable table)

Here you can find the source of getRealRowPos(int rowPos, JTable table)

Description

get Real Row Pos

License

Open Source License

Declaration

public static int getRealRowPos(int rowPos, JTable table) 

Method Source Code

//package com.java2s;

import javax.swing.JTable;

public class Main {

    public static int getRealRowPos(int rowPos, JTable table) {
        if (rowPos == -1) {
            // System.out.println("getRealRowPos => " + rowPos);
            return rowPos;
        }/*from   w w w  . ja va 2 s  .c  o  m*/
        if (table.getRowSorter() == null) {
            // System.out.println("getRealRowPos[no sort] => " + rowPos);
            return rowPos;
        }
        int fixRowPos = table.getRowSorter().convertRowIndexToModel(rowPos);
        // System.out.println(String.format("getRealRowPos[fix] => before[%d],
        // after[%d]", rowPos, fixRowPos));
        return fixRowPos;
    }
}

Related

  1. ensureRowCount(int count, JTable table)
  2. firstRowIsVoid(TableModel model)
  3. getModelRowAtPoint(JTable table, Point point)
  4. getNullRow(TableModel tm)
  5. getReadableRow(JTable table, int maximumHiddenPart)
  6. getRowBounds(JTable table, int first, int last)
  7. getRowByValue(TableModel model, Object value)
  8. getTableRow(TableModel tableModel, int row)
  9. hasRows(JTable table)