need to add icon for each node in JTree ????


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: need to add icon for each node in JTree ????

  1. #1
    Guy Guest

    need to add icon for each node in JTree ????


    hi,
    I need to add icon for each node in JTree,
    Please H E L P . . .

  2. #2
    Ruchi Dhar Guest

    Re: need to add icon for each node in JTree ????


    By default JTree will give you one icon for each node. You can override that
    behaviour by writing your own DefaultTreeCellRenderer for displaying different
    icons for node. If you want to give the default icons of your own you can
    call the following methods.

    UIManager.put("Tree.expandedIcon",
    new ImageIcon("images/tree_open.gif"));
    UIManager.put("Tree.collapsedIcon",
    new ImageIcon("images/tree_closed.gif"));


    "Guy" <guy__b@hotmail.com> wrote:
    >
    >hi,
    >I need to add icon for each node in JTree,
    >Please H E L P . . .



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center