Well, here is one way... maybe it will give you some ideas because I don't care for the code :
[code]
double a = m_table.getVisibleRect().getX();
double b = m_table.getVisibleRect().getY();
int row;
if (0 == a && 0 == b)
{
//may need to check for empty table
row = 0;
}
else
{
double cellHeight = m_table.getCellRect(0, 0, true).getHeight();
double num = Math.floor( b / cellHeight );
// y is the top of the jtable visible rectangle and
// height is the top to the bottom of the cell rectangle
// so we will need to add one to the result
row = num + 1;
}
[/code