 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rene Ruppert Guest
|
Posted: Thu Nov 27, 2003 5:04 pm Post subject: How to use JToolTip? |
|
|
Hi,
in my component I want to display dynamic tooltips, i.e. a different tooltip
is displayed each time you hover over the component.
I overrode createToolTip() with the following method but the String "TEST"
is never displayed...instead it always shows "HALLO" although the method
createToolTip() is called (I tested with the debugger).
class myComp() extends JComponent
{
public myComp()
{
setToolTipText("HALLO!");
}
public JToolTip createToolTip()
{
JToolTip toolTip = super.createToolTip();
toolTip.setTipText("TEST...");
return toolTip;
}
}
Any hints?
Rene
|
|
| Back to top |
|
 |
Rene Ruppert Guest
|
Posted: Mon Dec 01, 2003 8:05 am Post subject: Re: How to use JToolTip? |
|
|
Hallo,
| Quote: | Override getToolTipText(MouseEvent)
[...]
The ToolTipManager (naturally) calls setTipText again with the value of
your component's getToolTipText.
|
It worked. But what is createToolTip() good for anyway if you don't need to
override it?
When considering the help docs they say that overriding this method is the
correct way to display "your own tooltip".
cu
Rene
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|