f



change the icon of a JTree parent node according to its child nodes

Dear All

I am using SWING , JTree , in a software app. to monitor some hardware
devices using SNMP

I am organizing the devices in a JTree subclass

I have a parent node with some child nodes

I need to change the parent-node's icon according to some conditions in
its child-nodes

for example :
when a child-node.getX() > 1000
then its parent-node.icon should be changed

I think that I need to handle the paint of the parent-node but I don't
know how ?

Do  I need to have subclasses of TreeNode for both Parent and Child
nodes ?? I am using the MutableTreeNode for all my nodes !

Thanks in advance

Essam

0
esamsalah (7)
3/31/2005 10:55:57 AM
comp.lang.java.programmer 52714 articles. 1 followers. Post Follow

1 Replies
419 Views

Similar Articles

[PageSpeed] 44

esamsalah@gmail.com wrote:
> I need to change the parent-node's icon according to some conditions in
> its child-nodes

See the comp.lang.java.gui FAQ.

/Thomas

-- 
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
0
nobody89 (1641)
3/31/2005 2:07:02 PM
Reply: