int w = getIcon().getIconWidth();
int w = 0; if (getIcon() != null) w += getIcon().getIconWidth();
    public Component getTreeCellRendererComponent(JTree tree, Object value,                        boolean sel, boolean expanded, boolean leaf,                        int row, boolean hasFocus)    {        super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf,                                                 row, hasFocus);                if (!(value instanceof TreeImageDisplay)) return this;        TreeImageDisplay  node = (TreeImageDisplay) value;                if (node.getLevel() == 0) {            setIcon(icons.getIcon(IconManager.ROOT));            return this;        }        if (numberChildrenVisible) setText(node.getNodeText());        else setText(node.getNodeName());        setToolTipText(node.getToolTip());        setIcon(node.getUserObject());        Color c = node.getHighLight();        if (c == null) c = tree.getForeground();        setForeground(c);        if (!sel) setBorderSelectionColor(getBackground());        int w = getIcon().getIconWidth();        w += getIconTextGap();        FontMetrics fm = getFontMetrics(getFont());        w += fm.stringWidth(getText());        setPreferredSize(new Dimension(w, fm.getHeight()));                return this;    }