JLabel (@NlsContexts.Label String labelText, JComponent forComponent) { JLabel label = new JLabel(); LabeledComponent.TextWithMnemonic.fromTextWithMnemonic(labelText).setToLabel(label); label.setLabelFor(forComponent); return label; }