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