Dimension gap = table.getInterCellSpacing();
Dimension gap = table.getIntercellSpacing();
    private int getColForPoint(Point p)    {      int x0 = table.getLocation().x;      int ncols = table.getColumnCount();      Dimension gap = table.getInterCellSpacing();      TableColumnModel cols = table.getColumnModel();            int x = p.x;      for (int i = 0; i < ncols; ++i)        {          int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width);          if (0 <= x && x < width)            return i;          x -= width;        }      return -1;    }