I am writing a program that display a Jtree and in doing so i would like to change the name of the node from file to a string. The reason i make it a file in the first place is so that it give me the folder icon if it is a directory etc.. The problem is i don t want to show the full file path in the Jtree so I change the name of the node but when i do this the icon can change as the name is no longer a file.
Is there a way to lock the DefaultTreeCellRenderer so that node does not change or is there a better way to change the name so that the DefaultTreeCellRenderer does not change the icon