Component target = c; while (target != null && target.getMouseListeners().length == 0)
Component[] children = c.getComponents(); Component target = null; if (c != null)
  private Component findTarget(Component c)  {    Component target = c;    while (target != null && target.getMouseListeners().length == 0)      {        target = target.getParent();      }    return target;  }