Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change font color of Jradiobuttons using the UImanager

I know I how to change the font of a JRadioButton using UIManager and I know how to change the color of a JRadioButton, one button at a time. However is there a way, using the UIManager to change all JradioButtons in my application so that the font is, say white, instead of the default black.

like image 524
Elliott Avatar asked Jan 30 '12 03:01

Elliott


1 Answers

You can change the UIDefaults early in your program:

UIDefaults uiDefaults = UIManager.getDefaults();
uiDefaults.put("RadioButton.foreground", new ColorUIResource(Color.white));

Just be sure to use a contrasting color for the background.

like image 140
trashgod Avatar answered Oct 19 '22 02:10

trashgod