Dimension gap = table.getInterCellSpacing();
Dimension gap = table.getIntercellSpacing();
    private int getRowForPoint(Point p)    {            int y0 = table.getLocation().y;      int nrows = table.getRowCount();      Dimension gap = table.getInterCellSpacing();      int height = table.getRowHeight() + (gap == null ? 0 : gap.height);      int y = p.y;      for (int i = 0; i < nrows; ++i)        {          if (0 <= y && y < height)            return i;          y -= height;        }      return -1;    }