src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java

Print this page

        

@@ -2325,12 +2325,13 @@
             super(xpValue, classicValue);
             this.extraMargin = extraMargin;
         }
 
         public Object getXPValue(UIDefaults table) {
-            Border xpBorder = XPStyle.getXP().getBorder(null, (Part)xpValue);
-            if (extraMargin != null) {
+            XPStyle xp = XPStyle.getXP();
+            Border xpBorder = xp != null ? xp.getBorder(null, (Part)xpValue) : null;
+            if (xpBorder != null && extraMargin != null) {
                 return new BorderUIResource.
                         CompoundBorderUIResource(xpBorder, extraMargin);
             } else {
                 return xpBorder;
             }

@@ -2342,11 +2343,12 @@
             super(new XPColorValueKey(part, state, prop), classicValue);
         }
 
         public Object getXPValue(UIDefaults table) {
             XPColorValueKey key = (XPColorValueKey)xpValue;
-            return XPStyle.getXP().getColor(key.skin, key.prop, null);
+            XPStyle xp = XPStyle.getXP();
+            return xp != null ? xp.getColor(key.skin, key.prop, null) : null;
         }
 
         private static class XPColorValueKey {
             Skin skin;
             Prop prop;