🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10688

setting image icons for Leaf nodes in Jtree component

#10688
From: Chitra Amarnath
Date: Thu, 19 Aug 1999 00:00
16 lines
1091 bytes
Hi,

I have a jtree component with all the child nodes set. I am trying to
set the icons for the leaf nodes to an image file where the code looks
like this 

DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();
renderer.setLeafIcon(new ImageIcon("images/smile.gif"));     
tree.setCellRenderer(renderer);

I have the image file under the webserver root directory. But for some
reason it doesn't show the image icon on the leaf nodes. 

I would really appreciate any help in this regard.

Chitra
Technical Details
Message-ID: <37BC28CC.ACEA2D01@enterpriseworks.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a103f5c684bb2ee5,start
X-Google-Attributes: gid111d45,public
From: Chitra Amarnath <chitra.amarnath@enterpriseworks.com>
Subject: setting image icons for Leaf nodes in Jtree component
Date: 1999/08/19
Message-ID: <37BC28CC.ACEA2D01@enterpriseworks.com>
X-Deja-AN: 514727477
Content-Transfer-Encoding: 7bit
Organization: Another Netscape Collabra Server User
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing