--- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java 2014-07-10 18:18:48.421110100 +0400 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java 2014-07-10 18:18:47.551499700 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, 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 @@ -37,6 +37,7 @@ import static com.sun.java.swing.plaf.windows.TMSchema.Part; import static com.sun.java.swing.plaf.windows.TMSchema.State; import static com.sun.java.swing.plaf.windows.XPStyle.Skin; + import sun.swing.DefaultLookup; import sun.swing.StringUIClientPropertyKey; @@ -231,6 +232,9 @@ private void paintXPComboBoxBackground(Graphics g, JComponent c) { XPStyle xp = XPStyle.getXP(); + if (xp == null) { + return; + } State state = getXPComboBoxState(c); Skin skin = null; if (! comboBox.isEditable() @@ -400,17 +404,18 @@ * @return a button which represents the popup control */ protected JButton createArrowButton() { - if (XPStyle.getXP() != null) { - return new XPComboBoxButton(); + XPStyle xp = XPStyle.getXP(); + if (xp != null) { + return new XPComboBoxButton(xp); } else { return super.createArrowButton(); } } private class XPComboBoxButton extends XPStyle.GlyphButton { - public XPComboBoxButton() { + public XPComboBoxButton(XPStyle xp) { super(null, - (! XPStyle.getXP().isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT)) + (! xp.isSkinDefined(comboBox, Part.CP_DROPDOWNBUTTONRIGHT)) ? Part.CP_DROPDOWNBUTTON : (comboBox.getComponentOrientation() == ComponentOrientation.RIGHT_TO_LEFT) ? Part.CP_DROPDOWNBUTTONLEFT @@ -423,10 +428,11 @@ protected State getState() { State rv; rv = super.getState(); + XPStyle xp = XPStyle.getXP(); if (rv != State.DISABLED && comboBox != null && ! comboBox.isEditable() - && XPStyle.getXP().isSkinDefined(comboBox, - Part.CP_DROPDOWNBUTTONRIGHT)) { + && xp != null && xp.isSkinDefined(comboBox, + Part.CP_DROPDOWNBUTTONRIGHT)) { /* * for non editable ComboBoxes Vista seems to have the * same glyph for all non DISABLED states