1

Some of the names are clear, like background, foreground, focus etc. But some are just confusing, like light, hightlight, shadow, darkshardow etc. I noticed that these are consistently used in swing UI, so I infer these are part of java's jargon. Does any body know if there is a document out there that explains these names ?

RadioButton.background  
RadioButton.darkShadow  
RadioButton.disabledText    
RadioButton.focus           
RadioButton.foreground  
RadioButton.highlight   
RadioButton.light           
RadioButton.select          
RadioButton.shadow          
mKorbel
  • 109,525
  • 20
  • 134
  • 319
ShaggyInjun
  • 2,880
  • 2
  • 31
  • 52
  • Why not individually change them to something like pink and see what happens? –  Mar 03 '13 at 01:28
  • I have been trying that for weeks now, nothing seems to get affected, especially with light, highlight :( – ShaggyInjun Mar 03 '13 at 01:29

1 Answers1

5

These are UIResource elements related to JRadionButton. Each Look & Feel provides different radio button appearance, and may set different defaults for these elements. It is also to up to L&F implementation to use these keys or not.

For example, here is a method from javax.swing.plaf.basic.BasicBorders that uses RadioButton.light and RadioButton.highlight:

public static Border getRadioButtonBorder() {
UIDefaults table = UIManager.getLookAndFeelDefaults();
Border radioButtonBorder = new BorderUIResource.CompoundBorderUIResource(
           new BasicBorders.RadioButtonBorder(
                   table.getColor("RadioButton.shadow"),
                                       table.getColor("RadioButton.darkShadow"),
                                       table.getColor("RadioButton.light"),
                                       table.getColor("RadioButton.highlight")),
                     new MarginBorder());
return radioButtonBorder;
}

However, it is may not be used by concrete L&F implementations.

PS: UIManager Defaults by @camickr can be handy to visualize different keys.

tenorsax
  • 21,123
  • 9
  • 60
  • 107