![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e688. Setting an Accessible Name for an Image ButtonYou should also set the accessible name for components that only show an image. The tool tip text, if set, serves as the accessible name for a component. However, if the tool tip text is being used for something else, set the component's accessible name.JButton button = new JButton(new ImageIcon("image.gif")); button.setToolTipText("Button Name"); // If tool tip is being used for something else, set the accessible name. button.getAccessibleContext().setAccessibleName("Button Name");
e689. Setting a Description for Image Icons e690. Setting a Mnemonic for Buttons e691. Setting a Mnemonic for a Menu e692. Associating a Label with a Component e693. Setting a Keyboard Accelerator for a Menu Item © 2002 Addison-Wesley. |