changeset 4911:214f68c9b1a9

7149005: [macosx] Java Control Panel's UI controls are distorted when draging scroll bar. Reviewed-by: anthony, dcherepanov
author alexp
date Thu, 22 Mar 2012 02:52:20 +0300
parents af118cc1bef7
children aef6d319f066
files src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Thu Mar 22 02:44:01 2012 +0300
+++ b/src/macosx/classes/com/apple/laf/AquaButtonLabeledUI.java	Thu Mar 22 02:52:20 2012 +0300
@@ -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();