JComponent (JComponent component) { if (component instanceof LabeledComponent) { component = ((LabeledComponent<?>)component).getComponent(); } if (component instanceof FragmentWrapper wrapper) { component = wrapper.getComponentToRegister(); } if (component instanceof ComponentWithBrowseButton) { component = ((ComponentWithBrowseButton<?>)component).getChildComponent(); } return component; }