void (SettingsEditor<?> fragment) { JComponent component = fragment.getComponent(); for (Component childComponent : component.getComponents()) { if (childComponent instanceof PanelWithAnchor) { UIUtil.runWhenVisibilityChanged(childComponent, () -> SwingUtilities.invokeLater(() -> { alignPanels(component); })); } } }