I have JTreeone that provides objects that implement the interface TreeNode, and a user one TreeModelto display them (without using DefaultMutableTreeNode). I would like to change the text color of some nodes. I can’t find anything in the documents except javax.swing.tree.DefaultTreeCellRenderer.setTextNonSelectionColor(Color newColor), but it will change everything indiscriminately, and I need it only for some nodes (in particular, broken links, that is, nodes whose corresponding files cannot be found on the disk should be highlighted grayed out, the rest should be the default). Can this be done and how?
source
share