void () { super.initTree(); if (!myTreeWasInitialized) { myTreeWasInitialized = true; final FacetsTreeCellRenderer separatorRenderer = new FacetsTreeCellRenderer(); final TreeCellRenderer oldRenderer = myTree.getCellRenderer(); myTree.setCellRenderer(new TreeCellRenderer() { @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (value instanceof MyNode && ((MyNode)value).getConfigurable() instanceof FrameworkDetectionConfigurable) { return separatorRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } return oldRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } }); myTree.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { revalidateTree(); } @Override public void componentMoved(ComponentEvent e) { revalidateTree(); } @Override public void componentShown(ComponentEvent e) { revalidateTree(); } }); } }