Results 1 to 3 of 3
  1. #1
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default jtree painting treenodes

    Hello

    in my code

    getTreeCellRendererComponent

    paints the tree

    the aim to detect the leaf node ( which i did ) and set its color to say for eg green ( this also works ) now i want to traverse the upto the top of the tree i.e with

    DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
    DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
    // code to set the parent to GREEN
    setForeground(Color.GREEN);
    After this i want to set the parent node also to green

    I am not able to get the syntax for that in java

    Please help

    Kmm

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    Already answered: Swing - TreeNode color problem
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    kmm1977 is offline Member
    Join Date
    May 2010
    Posts
    47
    Rep Power
    0

    Default jtree problem

    sorry i thought these two different forums
    is it the same ?

    i posted in two so that i can a reply faster i.e. if one does reply , other will
    hopefully

Similar Threads

  1. Images don't painting
    By daniel.henrique in forum New To Java
    Replies: 2
    Last Post: 02-12-2010, 11:48 AM
  2. Objects painting themselves?
    By martypapa in forum Java 2D
    Replies: 19
    Last Post: 02-06-2010, 04:08 AM
  3. painting problem
    By hannes in forum New To Java
    Replies: 3
    Last Post: 01-17-2010, 11:44 AM
  4. JPanel not always painting everything
    By ekted in forum AWT / Swing
    Replies: 0
    Last Post: 11-26-2009, 11:24 AM
  5. Move JTree item to another JTree.
    By Melki in forum AWT / Swing
    Replies: 8
    Last Post: 07-09-2009, 11:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •