ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(
FactoryFinder.APPLICATION_FACTORY);
Application application = applicationFactory.getApplication();
// Create an icon component that is to remain detached from the component tree.
Icon icon = (Icon) application.createComponent(Icon.COMPONENT_TYPE);
String buttonIconName = getButtonIconName();
icon.setName(buttonIconName);
// Create a button component that that is also to remain detached from the component tree.
Button button = (Button) application.createComponent(Button.COMPONENT_TYPE);
List<UIComponent> buttonChildren = button.getChildren();
buttonChildren.add(icon);