List of utility methods to do JTable Row Visible
double | computeVisibleRowsCount(JTable table) Returns the number of visible rows in the given table. return table.getParent().getBounds().getHeight() / table.getRowHeight();
|
void | ensureRowVisible(JTable table, int row) ensure Row Visible Rectangle r = table.getVisibleRect(); Rectangle rMid = table.getCellRect(row, 0, true); Rectangle rBefore = null; Rectangle rAfter = null; if (row < table.getModel().getRowCount() - 1) rAfter = table.getCellRect(row + 1, 0, true); if (row > 0) { rBefore = table.getCellRect(row - 1, 0, true); ... |
void | ensureRowVisible(JTable table, int row) To make sure the row is visible. Rectangle r = table.getVisibleRect(); Rectangle rMid = table.getCellRect(row, 0, true); Rectangle rBefore = null, rAfter = null; if (row < table.getModel().getRowCount() - 1) rAfter = table.getCellRect(row + 1, 0, true); if (row > 0) rBefore = table.getCellRect(row - 1, 0, true); int yLow = (int) rMid.getMinY(); ... |
int | getFirstVisibleRow(JTable p_Table) get First Visible Row Point p = p_Table.getVisibleRect().getLocation();
return p_Table.rowAtPoint(p);
|
int | getFirstVisibleRowIndex(JTable table) Returns the row index of the last visible row. ComponentOrientation or = table.getComponentOrientation(); Rectangle r = table.getVisibleRect(); if (!or.isLeftToRight()) { r.translate((int) r.getWidth() - 1, 0); return table.rowAtPoint(r.getLocation()); |
int | getLastVisibleRow(JTable p_Table) get Last Visible Row Point p = p_Table.getVisibleRect().getLocation(); p.y = p.y + p_Table.getVisibleRect().height - 1; int result = p_Table.rowAtPoint(p); if (result > 0) return result; if (p_Table.getVisibleRect().height > 0) return p_Table.getRowCount() - 1; else ... |
int | getLastVisibleRow(JTable p_Table) get Last Visible Row Point p = p_Table.getVisibleRect().getLocation(); p.y = p.y + p_Table.getVisibleRect().height - 1; int result = p_Table.rowAtPoint(p); if (result > 0) { return result; if (p_Table.getVisibleRect().height > 0) { return p_Table.getRowCount() - 1; ... |
int | getLastVisibleRowIndex(JTable table) Returns the row index of the last visible row. ComponentOrientation or = table.getComponentOrientation(); Rectangle r = table.getVisibleRect(); r.translate(0, (int) r.getHeight() - 1); if (or.isLeftToRight()) { r.translate((int) r.getWidth() - 1, 0); if (table.rowAtPoint(r.getLocation()) == -1) { if (getFirstVisibleRowIndex(table) == -1) { ... |
int | getLeadingRow(JTable table, Rectangle visibleRect) get Leading Row return table.rowAtPoint(getLeadingPoint(table, visibleRect));
|
int | getVisibleRowCount(JTable list) get Visible Row Count Rectangle visibleRect = list.getVisibleRect();
return getTrailingRow(list, visibleRect) - getLeadingRow(list, visibleRect) + 1;
|