void (Comp component) { if (myComponent != null) remove(myComponent); myComponent = component; if (myComponent != null) { add(myComponent, BorderLayout.CENTER); } if (myComponent instanceof ComponentWithBrowseButton && !(myComponent instanceof TextFieldWithBrowseButton)) { myLabel.setLabelFor(((ComponentWithBrowseButton<?>)myComponent).getChildComponent()); } else { myLabel.setLabelFor(myComponent); } }