private void unregister(Component component) {

    if (component instanceof Container container && processChildren(container)) {
      for (int i = 0; i < container.getComponentCount(); i++) {
        unregister(container.getComponent(i));
      }
      container.removeContainerListener(myContainerListener);
    }

    unprocessComponent(component);
  }
private void unregister(Component component)