Reputation: 701
When a tool tip is displayed on a tree and the mouse is moved the tooltip stays visible and the text changes. Is it possible to hide the tool tip and redisplay it when the mouse moves from one item to the next.
Upvotes: 2
Views: 637
Reputation: 1038
you will have to use setToolTipText(null) to remove the tool tip - it will not disappear with our explicitly doing so.
Upvotes: 0
Reputation: 205785
Extend DefaultTreeCellRenderer
and invoke setToolTipText()
as required. The tutorial project TreeIconDemo2
, discussed in Customizing a Tree's Display, demonstrates the approach.
Addendum: You can supply the desired text for each node in a TreeCellRenderer
, e.g. MyRenderer
:
setToolTipText(value + " is in the Tutorial series.");
Upvotes: 1