Swing: is there a way to change the flag / radio color?

I would like to add some visual emphasis to a particular flag or radio object, and it seems that the simplest thing would be to change the color to green or red. Is there any way to do this?

I know that you can define bitmaps for these elements from scratch, but I would like them to look identical to the base look / feel, except for the color.

+3
source share
3 answers

You can try to use setForeground()and see if the user interface supports this option. However, this definitely depends on the particular user interface class and thus Look-and-Feel.

+1
source

There is always the opportunity to change the background or set the border, but I understand that not what you had in mind?

I don’t think that you can change the real box without playing with Look and Feel. Of course, I would gladly consider myself wrong.

+1
source
+1

Source: https://habr.com/ru/post/1760082/


All Articles