code: public static Component getDescendantNamed(String name, Component parent) {
  
          Assert.notNull(name, "name");
          Assert.notNull(parent, "parent");
  
          if (name.equals(parent.getName())) { // Base case
              return parent;
          } else if (parent instanceof Container) { // Recursive case
              for (final Component component : ((Container) parent).getComponents()) {
  
                  final Component foundComponent = SwingUtils.getDescendantNamed(name, component);
  
                  if (foundComponent != null) {
                      return foundComponent;
                  }
              }
          }
  
          return null;
      }
docs: Does a pre-order search of a component with a given name.
  
  @param name
  the name.
  @param parent
  the root component in hierarchy.
  @return the found component (may be null).