void (@NotNull Component component) { if (component instanceof Container container) { synchronized (container.getTreeLock()) { int componentCount = container.getComponentCount(); for (int i = 0; i < componentCount; i++) { Component child = container.getComponent(i); if (child != null) { installImpl(child); } } container.addContainerListener(this); } } if (component instanceof JMenuItem || component instanceof JMenuBar) { return; } component.addFocusListener(this); }