In BasicButtonUI we may only clear background and foreground colors if
they are UIResource instances. This is so that application defined
colors are not overridden when changing the theme or L&F.

2006-03-21  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicButtonUI.java
        (uninstallDefaults): Only nullify button colors if they are
        not UIResource instances.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/plaf/basic/BasicButtonUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicButtonUI.java,v
retrieving revision 1.36
diff -u -r1.36 BasicButtonUI.java
--- javax/swing/plaf/basic/BasicButtonUI.java	17 Mar 2006 20:53:09 -0000	1.36
+++ javax/swing/plaf/basic/BasicButtonUI.java	21 Mar 2006 14:53:08 -0000
@@ -172,8 +172,10 @@
   {
     if (b.getFont() instanceof UIResource)
       b.setFont(null);
-    b.setForeground(null);
-    b.setBackground(null);
+    if (b.getForeground() instanceof UIResource)
+      b.setForeground(null);
+    if (b.getBackground() instanceof UIResource)
+      b.setBackground(null);
     if (b.getBorder() instanceof UIResource)
       b.setBorder(null);
     b.setIconTextGap(defaultTextIconGap);

Reply via email to