242 |
protected void installDefaults() |
protected void installDefaults() |
243 |
{ |
{ |
244 |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
245 |
|
Font f = comboBox.getFont(); |
246 |
if (comboBox.getFont() instanceof UIResource) |
Color fore = comboBox.getForeground(); |
247 |
|
Color back = comboBox.getBackground(); |
248 |
|
if (f == null || f instanceof UIResource) |
249 |
comboBox.setFont(defaults.getFont("ComboBox.font")); |
comboBox.setFont(defaults.getFont("ComboBox.font")); |
250 |
|
|
251 |
if (comboBox.getForeground() instanceof UIResource) |
if (fore == null || fore instanceof UIResource) |
252 |
comboBox.setForeground(defaults.getColor("ComboBox.foreground")); |
comboBox.setForeground(defaults.getColor("ComboBox.foreground")); |
253 |
|
|
254 |
if (comboBox.getBackground() instanceof UIResource) |
if (back == null || back instanceof UIResource) |
255 |
comboBox.setBackground(defaults.getColor("ComboBox.background")); |
comboBox.setBackground(defaults.getColor("ComboBox.background")); |
256 |
|
|
257 |
// fetch the button color scheme |
// fetch the button color scheme |