FontMetrics fm = getToolkit().getFontMetrics(f);  return new Dimension(SwingUtilities.computeStringWidth(fm, s), fm.getHeight());
size.height = renderer.getPreferredSize().height;
    public Dimension getPreferredSize()    {      String s = getText();      Font f = getFont();      if (f != null)        {          FontMetrics fm = getToolkit().getFontMetrics(f);          return new Dimension(SwingUtilities.computeStringWidth(fm, s),                               fm.getHeight());        }      return renderer.getPreferredSize();    }