String s = getText();  Font f = getFont();  if (f != null)
Dimension size = super.getPreferredSize(); if (renderer != null && DefaultTreeCellEditor.this.getFont() == null)
    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();    }