7149005: [macosx] Java Control Panel's UI controls are distorted when draging scroll bar.
authoralexp
Sat, 12 May 2012 17:46:00 +0400
changeset 12650 0006acd3a5fa
parent 12649 331b9dca607f
child 12651 8c69dd24bf07
7149005: [macosx] Java Control Panel's UI controls are distorted when draging scroll bar. Reviewed-by: serb
jdk/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java
--- a/jdk/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Sat May 12 12:01:36 2012 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Sat May 12 17:46:00 2012 +0400
@@ -30,6 +30,7 @@
 
 import javax.swing.*;
 import javax.swing.border.Border;
+import javax.swing.plaf.UIResource;
 import javax.swing.plaf.basic.BasicHTML;
 import javax.swing.text.View;
 
@@ -76,8 +77,11 @@
     protected void setThemeBorder(final AbstractButton b) {
         super.setThemeBorder(b);
 
-        // Set the correct border
-        b.setBorder(AquaButtonBorder.getBevelButtonBorder());
+        Border border = b.getBorder();
+        if (border == null || border instanceof UIResource) {
+            // Set the correct border
+            b.setBorder(AquaButtonBorder.getBevelButtonBorder());
+        }
     }
 
     protected abstract AquaButtonBorder getPainter();