Setting tool tip background color/ text color

Is there a command to set the tool tip background color/text color? I have tried looking in the components dir but can not seem to find any functions to set the color of the tool tip.

perhaps try with html code inside the text property ?

You could put the following code in a mouseEntered event script, and then put similar code in the mouseExited event script to change the background back.

from javax.swing import UIManager
from java.awt import Color
UIManager.put("ToolTip.background", Color.RED)
UIManager.put("ToolTip.foreground", Color.BLUE)

Thank you that worked out great.

Do you happen to know what the default is so I can put it back to the default in the mouse exited event?


No, but if you restart your Designer you can find out with this:

print UIManager.get("ToolTip.background")
print UIManager.get("ToolTip.foreground")

Great it looks to be

UIManager.put(“ToolTip.background”, Color(255,200,0,150))
UIManager.put(“ToolTip.foreground”, Color.BLACK)

for the default.