w += fm.stringWidth(node.toString());
w += fm.stringWidth(getText());
    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);                DefaultMutableTreeNode  node = (DefaultMutableTreeNode) value;        if (node.getLevel() == 0) {            setIcon(icons.getIcon(IconManager.ROOT));            return this;        }                Object usrObject = node.getUserObject();        Color c = null;        int w = 0;        FontMetrics fm = getFontMetrics(getFont());        if (usrObject instanceof ImageSet) {            ImageSet set = (ImageSet) usrObject;                        if (node instanceof TreeViewNode) {            	w += fm.stringWidth(((TreeViewNode) node).getNodeName());            	setText(((TreeViewNode) node).toString());            } else setText(set.toString());            setValues(set.getHierarchyObject(), null);            if (visibleColor) {                c = ((ImageSet) usrObject).getHighlight();                if (c == null) c = getForeground();                setForeground(c);            }        } else if (usrObject instanceof ImageNode) {            ImageNode imgNode = (ImageNode) usrObject;            w += fm.stringWidth(imgNode.toString());            if (node instanceof TreeViewNode) {            	w += fm.stringWidth(((TreeViewNode) node).getNodeName());            	setText(((TreeViewNode) node).toString());            }	            else setText(imgNode.toString());            if (thumbnail) setValues(imgNode.getHierarchyObject(),                    					imgNode.getThumbnail().getIcon());            else setValues(imgNode.getHierarchyObject(), null);            if (visibleColor) {                c = imgNode.getHighlight();                if (c == null) c = getForeground();                setForeground(c);            }        } else {            setText(node.toString());            setValues(usrObject, null);            w += fm.stringWidth(node.toString());        }        w += getIcon().getIconWidth();        w += getIconTextGap();        setPreferredSize(new Dimension(w, fm.getHeight()));        return this;    }