synchronized (getTreeLock ()) { if (! contains(x, y)) return null; for (int i = 0; i < ncomponents; ++i) {  if (!component[i].isVisible()) continue;  int x2 = x - component[i].x; int y2 = y - component[i].y; if (component[i].contains(x2, y2)) return component[i]; } return this; }
return locate (x, y);
  public Component getComponentAt(int x, int y)  {    synchronized (getTreeLock ())      {        if (! contains(x, y))          return null;        for (int i = 0; i < ncomponents; ++i)          {            // Ignore invisible children...            if (!component[i].isVisible())              continue;            int x2 = x - component[i].x;            int y2 = y - component[i].y;            if (component[i].contains(x2, y2))              return component[i];          }        return this;      }  }