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

Discussion in 'Java' started by esamsalah@gmail.com, Mar 31, 2005.

  1. Guest

    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
     
    , Mar 31, 2005
    #1
    1. Advertising

  2. Thomas Weidenfeller, Mar 31, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,668
  2. Bryan Ax
    Replies:
    6
    Views:
    570
    Peter Flynn
    May 17, 2006
  3. Replies:
    1
    Views:
    1,237
    Joe Kesselman
    Nov 1, 2006
  4. Luqman
    Replies:
    2
    Views:
    923
    Luqman
    Jun 5, 2007
  5. Replies:
    2
    Views:
    851
    Martin Honnen
    Mar 17, 2008
Loading...

Share This Page