--- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java 2014-06-06 12:20:10.004439500 +0400 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java 2014-06-06 12:20:09.463870900 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,7 +109,8 @@ static void paintBackground(WindowsMenuItemUIAccessor menuItemUI, Graphics g, JMenuItem menuItem, Color bgColor) { assert isVistaPainting(); - if (isVistaPainting()) { + XPStyle xp = XPStyle.getXP(); + if (xp != null && isVistaPainting()) { int menuWidth = menuItem.getWidth(); int menuHeight = menuItem.getHeight(); if (menuItem.isOpaque()) { @@ -118,7 +119,6 @@ g.fillRect(0,0, menuWidth, menuHeight); g.setColor(oldColor); } - XPStyle xp = XPStyle.getXP(); Part part = menuItemUI.getPart(menuItem); Skin skin = xp.getSkin(menuItem, part); skin.paintSkin(g, 0 , 0,