![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e692. Associating a Label with a ComponentWhen a label is associated with a component, you should callsetLabelFor() 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);
e688. Setting an Accessible Name for an Image Button e689. Setting a Description for Image Icons e690. Setting a Mnemonic for Buttons e691. Setting a Mnemonic for a Menu e693. Setting a Keyboard Accelerator for a Menu Item © 2002 Addison-Wesley. |