tags:

views:

128

answers:

2

Hi everyone,

I'm writing a program that lets people highlight surfaces by dragging the mouse. (Just like the highlighted rectangles you can do make in most operating systems on the desktop). Trouble is, what color should I use? I don't know of any color in UIDefaults that corresponds to the highlight color. SystemColor.controlHighlight is also no good. (It's a light gray in Windows 7, not the deep blue you would expect for highlighting). Anyone know of a way to get Swing to give me an appropriate color for highlighting at runtime?

Thanks for your help!

+2  A: 

In the WindowsLookAndFeel class, the system color "textHighlight" defaults to blue. The comment for this color is "Text background color when selected", so it might be what you're looking for.

Ash
Thanks for your help, it's great for windows! I'll keep searching for an good color with GTK and Metal. But Aqua (SystemColor.controlHighlight) and Windows down.
Yuvi Masory
+3  A: 

Duncan Jauncey has a page that lists the UIDefaults keys for many different platforms.

Nate