Hi all.
Any of you know how could i set an image to a
tree.
i know about the DefaultTreeCellRenderer, and
the way to put an image for a leaf or closed(collapsed) or opened(expanded)
nodes, But what i need is to set for some elements(supose leaf nodes) an image,
and for others another image(e.g).
Obj1 obj1;
Obj2 obj2;
ImageIcon
imgObj1=getClass().getResource("obj1.gif");
ImageIcon
imgObj2=getClass().getResource("obj2.gif");
.....
so when i add my obj1 in my tree must appear
obj1.gif, same whit obj2..you know like JBuilder do in the project browser(if a
property is private, the icon is diferent to a public one). It is possible to
do..? Have you seen something like this before..? Any idea..?
Thanks in advance Romel
------------------------------------------------------
Romel Calero Ramos Est. Ciencia de la Computación Universidad de La Habana |
- Re: JTree and DefaultTreeCellRenderer Romel Calero Ramos
- Re: JTree and DefaultTreeCellRenderer Panyam Krishna Murthy
- Re: JTree and DefaultTreeCellRenderer Panyam Krishna Murthy
- Re: JTree and DefaultTreeCellRenderer Panyam Krishna Murthy