--- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java 2014-07-02 16:29:23.013412500 +0400 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java 2014-07-02 16:29:22.498903100 +0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, 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 @@ -322,8 +322,9 @@ private Rectangle getFullChunkBounds(Rectangle box) { boolean vertical = (progressBar.getOrientation() == JProgressBar.VERTICAL); XPStyle xp = XPStyle.getXP(); - int gap = xp.getInt(progressBar, Part.PP_PROGRESS, null, - Prop.PROGRESSSPACESIZE, 0); + int gap = (xp != null) ? xp.getInt(progressBar, Part.PP_PROGRESS, + null, Prop.PROGRESSSPACESIZE, 0) + : 0; if (!vertical) { int chunksize = box.width+gap; @@ -338,6 +339,9 @@ boolean vertical, int bgwidth, int bgheight) { XPStyle xp = XPStyle.getXP(); + if (xp == null) { + return; + } // create a new graphics to keep drawing surface state Graphics2D gfx = (Graphics2D)g.create(); @@ -396,6 +400,9 @@ private void paintXPBackground(Graphics g, boolean vertical, int barRectWidth, int barRectHeight) { XPStyle xp = XPStyle.getXP(); + if (xp == null) { + return; + } Part part = vertical ? Part.PP_BARVERT : Part.PP_BAR; Skin skin = xp.getSkin(progressBar, part);