target = target.getParent();
for (int i = 0; i < children.length; i++) { Component child = children[i]; if (child.isShowing()) { if (child.contains(loc.x - child.getX(), loc.y - child.getY()) && (child.getMouseListeners().length > 0 || child.getMouseMotionListeners().length > 0)) { target = child; break; } } }
  private Component findTarget(Component c)  {    Component target = c;    while (target != null && target.getMouseListeners().length == 0)      {        target = target.getParent();      }    return target;  }