Component (@NotNull JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component component = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); Object object = ((DefaultMutableTreeNode)value).getUserObject(); if (object instanceof PatternDescriptor) { setText(((PatternDescriptor)object).getName()); setIcon(((PatternDescriptor)object).getIcon()); } return component; }