Dynamically changing icons of some nodes in a JTree
Hi,
I am looking to change the icons in a Jtree nodes depending on some condition. For Example I am populating n number of Jobs in the Jtree under a single parent by reading a folder for xml files.
and some of the jobs might be currently running and i wish to show the icons for these running jobs with a green dot to differentiate them from other jobs. As follows
Jobs
#job1
#job2
#job3
[OR]
Jobs
#job1
#job2
#job3
I just need to differentiate it from other jobs be it the icon changing or the text color changing.
Any suggestions?
Regards
--vishnu--
Re: Dynamically changing icons of some nodes in a JTree
I guess you didn't like the answers I already gave you? :-/
This thread has been cross posted here:
http://www.java-forums.org/awt-swing/64155-dynamically-changing-icons-some-nodes-jtree.html
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting
Re: Dynamically changing icons of some nodes in a JTree
Kevin,
I appreciate your help very much.
Its' just that I did not know that these two forums are the same. I thought they were different. If not i would never have cross posted this. I was just looking for a quick solution and hence thought i might get different people on different forums :P.
Re: Dynamically changing icons of some nodes in a JTree
They aren't the same. But a lot of people happen to look at both. Please read the "problems with cross posting" link for information on why people don't like crossposting.
Re: Dynamically changing icons of some nodes in a JTree
Sorry! Will try not to do this again %-(
Re: Dynamically changing icons of some nodes in a JTree
It's not really a big deal as long as you let people know you're doing it. A little blurb saying "by the way, I also posted this here..." goes a long way. That way it's easy for people to see what kind of help you've already received, otherwise we might be wasting our time repeating advice you've already heard.