Rectangle vr = new Rectangle();
Font font = progressBar.getFont(); FontMetrics fm = progressBar.getFontMetrics(font);
  protected Dimension getPreferredInnerHorizontal()  {    Rectangle vr = new Rectangle();    SwingUtilities.calculateInnerArea(progressBar, vr);    return new Dimension(vr.width, vr.height);  }