Dienstag, 30. Januar 2007

How to set the ToolTip Color of a single Component?

Problem:
"Using the
UIManager I can only set the ToolTip Color for all Components. I want to set the Color for a single Components like a Button etc. How do I do this?"



Solution:
You need to overwrite theComponents
createToolTip method. For example like this:

public JToolTip createToolTip() {
JToolTip jt = new JToolTip();
jt.setForeground(Color.RED);
jt.setBackground(Color.BLACK);
return jt;
}

Keine Kommentare: