Setting the color of a disabled checkbox...
Hi,
how do I set the color of a (disabled)JCheckBox because the following code does not work for me:
jCheckBox1.setForeground(Color.BLACK);
The background is that I don't want to have the checkbox in this grey (disabled) style, instead it should look like a "normal" checkbox (but disabled).
Any ideas?
Best regards
- Stephan
[377 byte] By [
Jacklera] at [2007-11-27 10:29:26]

# 2
> UIManager.put("CheckBox.disabledText",Color.BLAC
> K);
Hi Michael_Dunn,
I want to see all the possible values which can be passed as key to the UIManager, is there any way to see them?
max25a at 2007-7-28 17:57:26 >

# 3
search the forum for the link to camickr's ShowUIDefaults program.
(you'll find lots of posts)
works fine in 1.4, 1.5, but, as usual, new version 1.6 breaks it.
compile, then wrap the ClassCastException line in a try/catch{}, recompile,
and it works fine
# 6
WindowsLookAndFeel uses native APIs to draw most of the controls. So, a disabled checkbox under Windows LAF will use the same API as the native disabled checkbox. You can install a custom JXLayer on that checkbox to prevent all the events from being passed to it - not the cleanest solution, but it will get you there (and make your users annoyed that they can't click on that checkbox).