/**
* Returns the row index of the last visible row.
*
*/
int getLastVisibleRowIndex(JTable table)
{
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);
// The next if makes sure that we don't return -1 simply because
// there is white space at the bottom of the table (ie, the display
// area is larger than the table)
if (table.rowAtPoint(r.getLocation()) == -1)
{
if (getFirstVisibleRowIndex(table) == -1)
return -1;
else
return table.getModel().getRowCount() - 1;
}
return table.rowAtPoint(r.getLocation());
}
BasicTableUI.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:javify
作者:
评论列表
文章目录