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