Hi there, I'm trying to do a small project where I can display my own icons in a JTree. However, when I attempt to run the code below the icons don't get displayed. I've tried various combinations of code all resulting the same, no icons. Please look over my code and tell me where I went wrong. Thanks, Alan
[ October 14, 2003: Message edited by: Michael Ernest ]
hi first check whether the image is loading properly. because if the image is not loaded or if it is not the location no error is thrown. if all r ok then try the below method. getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) override this method and check whether the node is leaf or closed or opened and then set the icon. hope this helps u Marcus
"No one knows what one can do until one tries"<br />-John Kingsley.