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

    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
    Rep Power


    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. action to a node in a jtree
    By sniffer139 in forum AWT / Swing
    Replies: 4
    Last Post: 08-29-2014, 03:51 PM
  2. Collapse previous expanded node in JTree
    By png in forum AWT / Swing
    Replies: 0
    Last Post: 06-28-2010, 09:23 AM
  3. Multiple components as one node in JTree
    By Amnuriak in forum AWT / Swing
    Replies: 8
    Last Post: 11-04-2009, 03:47 PM
  4. How to add JCheckbox as a node in JTree
    By shajuantony in forum New To Java
    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