void (final Bound boundComponent) { myBoundComponent = createMainComponent(boundComponent); final JComponent highlightedComponent = getHighlightedComponent(myBoundComponent); myDefaultForeground = highlightedComponent.getForeground(); myDefaultBackground = highlightedComponent.getBackground(); final JComponent component = getComponentToListenFocusLost(myBoundComponent); if (component != null) { component.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { } @Override public void focusLost(FocusEvent e) { if (!e.isTemporary() && isValid()) { commit(); } } }); } updateComponent(); }