Results 1 to 2 of 2
  1. #1
    Anandababu is offline Member
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default How to change the individual node Icon of a JTree based on the user action?

    Hi all, i'm new to swing components,

    i just want to change the ICON or Text Color of the selected node, when user clicks a button.

    i've seen some wensites and examples regarding this, but all are given to change the icon for the whole tree, i just want to change only for the user selected node's icon based on the button's actionPerformed() event.

    Please help me in this in a simple way , so that i can understand ....

    Thank you.

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    It is easy...

    I think if a component can be setIcon() it can be also getIcon() ;)
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

Similar Threads

  1. Collapse previous expanded node in JTree
    By png in forum AWT / Swing
    Replies: 0
    Last Post: 06-28-2010, 09:23 AM
  2. action to a node in a jtree
    By sniffer139 in forum AWT / Swing
    Replies: 2
    Last Post: 04-16-2010, 05:18 AM
  3. Multiple components as one node in JTree
    By Amnuriak in forum AWT / Swing
    Replies: 8
    Last Post: 11-04-2009, 02:47 PM
  4. How to add JCheckbox as a node in JTree
    By shajuantony in forum javax.swing
    Replies: 0
    Last Post: 04-09-2009, 07:19 AM
  5. Node selection in jtree
    By Preethi in forum AWT / Swing
    Replies: 4
    Last Post: 06-19-2008, 11:25 PM

Posting Permissions

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