void (JLabel typeSelectorLabel, JLabel nameLabel) { if(myTypeSelector.getFocusableComponent() != null) { typeSelectorLabel.setLabelFor(myTypeSelector.getFocusableComponent()); } if(myNameField.getFocusableComponent() != null) { nameLabel.setLabelFor(myNameField.getFocusableComponent()); } }