{ if (textH < 200) textH = 200; if (textW < 20) textW = 20; } textW += insets.left + insets.right; textH += insets.top + insets.bottom; return new Dimension(textW, textH);
ret = getPreferredInnerHorizontal(); ret.width += insets.left + insets.right; ret.height += insets.top + insets.bottom; return ret;
  public Dimension getPreferredSize(JComponent c)  {    // The only thing we need to worry about is    // the text size.    Insets insets = c.getInsets();    // make a fontrenderer context so that we can make assumptions about    // the string bounds    FontRenderContext ctx = new FontRenderContext(new AffineTransform(),                                                  false, false);    Rectangle2D bounds = c.getFont().getStringBounds(progressBar.getString(),                                                     ctx);    int textW = (int) bounds.getWidth();    int textH = (int) bounds.getHeight();    if (progressBar.getOrientation() == JProgressBar.HORIZONTAL)      {	if (textH < 20)	  textH = 20;	if (textW < 200)	  textW = 200;      }    else      {	if (textH < 200)	  textH = 200;	if (textW < 20)	  textW = 20;      }    textW += insets.left + insets.right;    textH += insets.top + insets.bottom;    return new Dimension(textW, textH);  }