|
|
|
||||||||||||||||||
|
javax.accessibility
Code Samples Index These code examples and other materials are subject to Sun Microsystems, Inc. Legal Terms
Associating a Label with a ComponentWhen a label is associated with a component, you should call setLabelFor() to make the association explicit and then set a mnemonic on the label. The associated component will get the focus when the mnemonic is activated.
JLabel label = new JLabel("Name:");
label.setDisplayedMnemonic('N');
label.setLabelFor(component);
|