2

Guys I want to change the appearance of a disabled JRadioButton, JCheckBox

This code works well for ComboBox but when replaced by CheckBox or RadioButton no effect.

    UIManager.put("ComboBox.disabledForeground", Color.BLACK);

Also i want the Button to be non-editable. So dont suggest options like

    RadioButton.setEnabled(false);

What I get vs What i Want.

yole
  • 92,896
  • 20
  • 260
  • 197
  • Not the beautifullest way, but you may want to take a look at this: http://stackoverflow.com/questions/3130650/how-can-i-replicate-disabled-appearance-for-a-jcheckbox – Luftbaum Dec 04 '16 at 15:04

1 Answers1

2

This code works well for ComboBox but when replaced by CheckBox or RadioButton no effect.

UIManager.put("ComboBox.disabledForeground", Color.BLACK);

For a JCheckBox and JRadioButton you should be able to use:

UIManager.put("CheckBox.disabledText", Color.BLACK);
UIManager.put("RadioButton.disabledText", Color.BLACK);

Check out UIManager Defaults for all the default values of the UIManager.

camickr
  • 321,443
  • 19
  • 166
  • 288