size.width = SwingUtilities.computeStringWidth(fm, s); size.width = size.width + getCurrentControlIcon(path).getIconWidth() + gap + getNodeIcon(path).getIconWidth(); size.height = getMaxHeight(tree); size.y = size.height * row;
size.y = prefSize.height * row; size.width =  prefSize.width; size.height = prefSize.height;
    public Rectangle getNodeDimensions(Object cell, int row, int depth,                                       boolean expanded, Rectangle size)    {      if (size == null || cell == null)      return null;      String s = cell.toString();      Font f = tree.getFont();      FontMetrics fm = tree.getToolkit().getFontMetrics(f);      if (s != null)        {          TreePath path = treeState.getPathForRow(row);          size.x = getRowX(row, depth);          size.width = SwingUtilities.computeStringWidth(fm, s);          size.width = size.width + getCurrentControlIcon(path).getIconWidth()                       + gap + getNodeIcon(path).getIconWidth();          size.height = getMaxHeight(tree);          size.y = size.height * row;        }      return size;    }