AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use JToolTip?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Rene Ruppert
Guest





PostPosted: Thu Nov 27, 2003 5:04 pm    Post subject: How to use JToolTip? Reply with quote



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





PostPosted: Mon Dec 01, 2003 8:05 am    Post subject: Re: How to use JToolTip? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.