if (progressBar.isStringPainted())
if (progressBar.isStringPainted() && !progressBar.getString().equals(""))
  protected void paintDeterminate(Graphics g, JComponent c)  {    Color saved = g.getColor();    int space = getCellSpacing();    int len = getCellLength();    int max = progressBar.getMaximum();    int min = progressBar.getMinimum();    int value = progressBar.getValue();    Rectangle vr = new Rectangle();    SwingUtilities.calculateInnerArea(c, vr);    Rectangle or = c.getBounds();    Insets insets = c.getInsets();    int amountFull = getAmountFull(insets, or.width, or.height);    g.setColor(c.getBackground());    g.fill3DRect(vr.x, vr.y, vr.width, vr.height, false);    if (max != min && len != 0 && value > min)      {	int iterations = value / (space + len);	if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)	  {	    double spaceInUnits = space * (double) vr.width / (max - min);	    double lenInUnits = len * (double) vr.width / (max - min);	    double currX = vr.x;	    g.setColor(c.getForeground());	    g.fill3DRect(vr.x, vr.y, amountFull, vr.height, true);	    g.setColor(c.getBackground());	    if (spaceInUnits != 0)	      {		for (int i = 0; i < iterations; i++)		  {		    currX += lenInUnits;		    g.fill3DRect((int) currX, vr.y, (int) spaceInUnits,		                 vr.height, true);		    currX += spaceInUnits;		  }	      }	  }	else	  {	    double currY = vr.y;	    double spaceInUnits = space * (double) vr.height / (max - min);	    double lenInUnits = len * (double) vr.height / (max - min);	    g.setColor(c.getForeground());	    g.fill3DRect(vr.x, vr.y + vr.height - amountFull, vr.width,	                 amountFull, true);	    g.setColor(c.getBackground());	    if (spaceInUnits != 0)	      {		for (int i = 0; i < iterations; i++)		  {		    currY -= lenInUnits + spaceInUnits;		    g.fill3DRect(vr.x, (int) currY, vr.width,		                 (int) spaceInUnits, true);		  }	      }	  }      }    if (progressBar.isStringPainted())      paintString(g, 0, 0, or.width, or.height, amountFull, insets);    g.setColor(saved);  }