• Post Reply Bookmark Topic Watch Topic
  • New Topic

ToolTipText color change.

 
Sonara Rahul
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I have a problem in tooltiptext.
I need to set Background & Foreground color for ToolTipText.
How could i set it.Need u'r suggestions.
Excepting u'r replies,
With regards,
Sonara.
 
Thomas Suer
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sonara!
If you want to change the back- and foreground color of all components try to set the 'ToolTip.background' and 'ToolTip.foreground' properties of the UIManager. Do this before any component gets displayed:
<code>
try
{
UIManager.put("ToolTip.background", Color.red);
UIManager.put("ToolTip.foreground", Color.yellow);
}
catch (Throwable th)
{
th.printStackTrace();
}
</code>
If you set the UIManager properties after the components are displayed you additionally have to invoke the components method updateUI(), for instance 'myTextField.updateUI();'
Good luck
Tom
 
Sonara Rahul
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tom,
Thanks a lot for u'r suggestion.
Really happy about the answer i got.
It's working.
Thanks,
with Regards,
Sonara.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!