Setting a Tool Tip

If a JComponent such as a JButton is created using an action, the component will be created with the tool tip text in the action (see 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");

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.