SwingUtilities.calculateInnerArea(progressBar, vr);
int stringWidth = 0; String str = progressBar.getString(); if (str != null) stringWidth = fm.stringWidth(progressBar.getString()); Insets i = progressBar.getInsets(); int prefHeight = Math.max(200 - i.left - i.right, stringWidth);
  protected Dimension getPreferredInnerVertical()  {    Rectangle vr = new Rectangle();    SwingUtilities.calculateInnerArea(progressBar, vr);    return new Dimension(vr.width, vr.height);  }