Here you can find the source of getModelRowAtPoint(JTable table, Point point)
public static int getModelRowAtPoint(JTable table, Point point)
//package com.java2s; //License from project: Open Source License import java.awt.Point; import javax.swing.JTable; import javax.swing.RowSorter; public class Main { public static int getModelRowAtPoint(JTable table, Point point) { int row = table.rowAtPoint(point); return rowToModelIndex(table, row); }/*from w w w .j a v a2s. c o m*/ public static int rowToModelIndex(JTable table, int row) { if (row >= 0) { RowSorter<?> rowSorter = table.getRowSorter(); return rowSorter != null ? rowSorter .convertRowIndexToModel(row) : row; } return -1; } }