Search code examples
javaswingtooltip

Why getToolTipText is never called?


I have got a JComponent. The paintComponent method is overridden. I mentioned that tooltips were not occuring reliable. Sometimes they were displayed and sometime they didn't. Now I don'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?


Solution

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