Mike O
Mike O

Reputation: 291

How do I get tooltips to activate on a JLayer-covered JComponent?

I have a Java class that extends JTextField and covers it with a JLayer (new Java 1.7 feature) in order to display custom graphical effects in certain conditions. Without the JLayer it is easy enough to add a tooltip using setToolTipText(String). But with the JLayer in place, nothing happens when I hold my mouse over the box. Perhaps it is blocking the mouse-over event? I also tried calling setToolTipText() on the JLayer object itself but it didn't make any difference. So how can I get the tooltip to work?

Upvotes: 1

Views: 228

Answers (1)

Joop Eggen
Joop Eggen

Reputation: 109613

Did you try overriding getToolTipText and return getView().getToolTipText()? Doubt it will help though.

Upvotes: 2

Related Questions