Question

My problem is like this:
I have a tree with root and 4 leafnodes.
I need to change icon of a particular node (say 2nd leaf node).

My algorithm is like this:
step 1: Find index of the required node
Step2:Change its icon
I am done with step 1,but strucked at step 2.
Please help me out....

Thank you all in advance....

Was it helpful?

Solution

If I am correctly understanding what you mean, you should have your answer in the link below. If you have the icon you want to change, just create an instance of the DefaultTreeCellRenderer and go from there. You can also use different lines for collapsing and expanding. Follow the steps on the link I am providing from Oracle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top