tags:

views:

38

answers:

3

I would like to add some visual emphasis to a particular checkbox or radiobutton, and it seems like the simplest would be to change the color to green or red. Is there a way to do this?

I know it's possible to define the bitmaps for these elements from scratch, but I would like them to look identical to the base look/feel, except for color.

+1  A: 

You could try using setForeground() and see whether the UI respects that setting. However, it definitely depends on the specific UI class and thus the Look-and-Feel.

Michael Borgwardt
+1  A: 

There is always the option of changing the background or setting a border, but I understand that's not what you had in mind?

I don't think it is possible to change the actual box without fiddling with the Look and Feel. I would love to be proven wrong, of course.

Tormod
+1  A: 

In addition to using UIManager or BorderFactory, you can place the component on a colored panel, as suggested in this example using a different component.

trashgod