This will change all the JRadioButton's checkmark color.
UIManager.put( "CheckBox.icon.checkmarkColor", Color.red ); LookAndFeel lookAndFeel = UIManager.getLookAndFeel(); try { UIManager.setLookAndFeel( lookAndFeel ); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } updateUI();
And then I want to only change radiobutton1's color while I click another button. But it does not work.
radiobutton1.putClientProperty( "CheckBox.icon.checkmarkColor",Color.yellow);
Asked
Active
Viewed 270 times
0

Mark Rotteveel
- 100,966
- 191
- 140
- 197

Alpha
- 1
- 1
1 Answers
0
Use "style" can do this.
radiobutton1.putClientProperty( FlatClientProperties.STYLE,"icon.checkmarkColor:#ffff66");
This can change only radiobutton1's "icon.checkmarkColor".

Alpha
- 1
- 1