src/share/classes/com/sun/java/swing/plaf/windows/WindowsProgressBarUI.java
Print this page
@@ -1,7 +1,7 @@
/*
- * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -320,12 +320,13 @@
}
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;
return new Rectangle(box.x-chunksize*2, box.y, chunksize*3, box.height);
} else {