🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to set the '+' sign in a JTree

#13095
From: Dino Fancellu
Date: Mon, 21 Sep 1998 00:00
19 lines
1189 bytes
Yes, the icon used depends on the current look and feel.

For example in Metal they use the MetalIconFactory to create the icon.
However it would be the MetalLookAndFeel which plops the icons into the
correct slots
in UIDefaults, which is where the control looks for defaults, which
thankfully
is the same for all current look and feel.

For example, say I wanted to change the collapsed icon, I could to this

import com.sun.java.swing.plaf.*;

UIManager.put("Tree.collapsedIcon",new IconUIResource(new
ImageIcon("stuff.gif")));

Make sure you do it in the beginning of your app.

Dino.
Technical Details
Message-ID: <360633E7.EA08793F@enterprise.netREMOVE>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6rju18$40a10@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,b5141442c56d5237
X-Google-Attributes: gid111d45,public
From: Dino Fancellu <dino@enterprise.netREMOVE>
Subject: Re: How to set the '+' sign in a JTree
Date: 1998/09/21
Message-ID: <360633E7.EA08793F@enterprise.netREMOVE>
X-Deja-AN: 393246099
Content-Transfer-Encoding: 7bit
References: <6rju18$40a10@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing