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

Print this page

        

@@ -154,12 +154,12 @@
         }
     }
 
     @Override
     public void paint(Graphics g, JComponent c) {
-        if (WindowsMenuItemUI.isVistaPainting()) {
             XPStyle xp = XPStyle.getXP();
+        if (xp != null && WindowsMenuItemUI.isVistaPainting()) {
             Skin skin;
             skin = xp.getSkin(c, Part.MP_BARBACKGROUND);
             int width = c.getWidth();
             int height = c.getHeight();
             State state =  isActive(c) ? State.ACTIVE : State.INACTIVE;