if (progressBar.getOrientation() == JProgressBar.VERTICAL) return;
String str = progressBar.getString(); int full = getAmountFull(b, width, height);
  protected void paintString(Graphics g, int x, int y, int width, int height,                             int amountFull, Insets b)  {    // FIXME: We do not support vertical text painting because Java2D is needed    // for this.    if (progressBar.getOrientation() == JProgressBar.VERTICAL)      return;    // We want to place in the exact center of the bar.    Point placement = getStringPlacement(g, progressBar.getString(),                                         x + b.left, y + b.top,                                         width - b.left - b.right,                                         height - b.top - b.bottom);    Color savedColor = g.getColor();    Shape savedClip = g.getClip();    FontMetrics fm = g.getFontMetrics(progressBar.getFont());    int full = getAmountFull(b, width, height);    String str = progressBar.getString();    // We draw this string two times with different clips so that the text    // over the filled area is painted with selectionForeground and over    // the clear area with selectionBackground.    g.setColor(getSelectionForeground());    g.setClip(0, 0, full + b.left, height);    g.drawString(str, placement.x, placement.y + fm.getAscent());    g.setColor(getSelectionBackground());    g.setClip(full + b.left, 0, width - full, height);    g.drawString(str, placement.x, placement.y + fm.getAscent());    g.setClip(savedClip);    g.setColor(savedColor);  }