![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e843. Setting a Tool TipIf aJComponent such as a JButton is created using an
action, the component will be created with the tool tip text in the action
(see e855 Creating an Action).
However, if the action does not have any tool tip text
or if it must be changed, use JComponent.setToolTipText() is used.
JComponent button = new JButton("Label"); // Set tool tip text button.setToolTipText("tool tip text");
e845. Enabling and Disabling Tool Tips e846. Making Tool Tips Appear Immediately e847. Making Tool Tips Remain Visible e848. Showing Multiple Lines in a Tool Tip e849. Showing an Image in a Tool Tip © 2002 Addison-Wesley. |