views:

125

answers:

3

I have got a JComponent. The paintComponent Mehtod is overridden. I mentioned that tooltips were not occuring reliable. Sometimes they were displayed and sometime they didn't. Now I dont't see tooltips anymore on this component. I overwrote getToolTipText(MouseEvent e) to specify the contents of the tooltips. But the methods getToolTipText() and getToolTipText(MouseEvent e) are never called!

What could be wrong here? What can I do to fix it?

Thanks in advance.

A: 

I believe you will need to call ToolTipManager.registerComponent. It's an optimisation, apparently.

Tom Hawtin - tackline
A: 

Have you set the tooltip with the method "setToolTipText(String)"?

When the tooltip is not set (or resettet with the value "null"), then the tooltip will not be displayed. (And i suggest the getToolTipText() method will not be called)

This link may help you with this problem: How To use Tooltips

(sorry about my english, i think it's not the best,,, ;-) )

mg
A: 

First you need to register with the TooltipManager via

TooltipManager.registerComponent()

Even if that doesent work then

  1. Check the value of TooltipManager.getInitialDelay()
  2. Check the value of TooltipManager.isEnabled()
Suraj Chandran