Reputation: 189686
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.
Upvotes: 3
Views: 1404
Reputation: 205785
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.
Upvotes: 1
Reputation: 464
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.
Upvotes: 1
Reputation: 346317
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.
Upvotes: 1