🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Jtree cell bgcolor

#13134
From: Vasudevan Srinivasan
Date: Wed, 09 Sep 1998 00:00
26 lines
1385 bytes
i created a new class and implemented TreeCellRenderer interface. also
you have to use the jtree1.setCellRenderer() method. but i cant set the
background color of the individual tree item. I have this code:
if (hasFocus) {
    setForegroundColor(Color.white);    // works fine
    setBackgroundColor(Color.blue);    // DOES NOT work; why ?
else {
    setForegroundColor(Color.black);        // works fine
    setBackgroundColor(Color.lightGray);    // works fine
}

PS:
i did not override the paint() method.
any body hit this problem before ?
tia
vasu

Vasudevan Srinivasan wrote:

> Hi,
> I have a jtree component and want it's cells to be same that of
> background color. the background color of cell is white and that of
> panel is gray. i used setOpaque with true & false but it made no
> difference.
> Can anyone suggest whats needed
> Thanks
Technical Details
Message-ID: <35F6A070.18927366@netrisk.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35F56B62.E5611031@netrisk.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,2b5fd7566c53b396
X-Google-Attributes: gid111d45,public
From: Vasudevan Srinivasan <vasudevan@netrisk.com>
Subject: Re: Jtree cell bgcolor
Date: 1998/09/09
Message-ID: <35F6A070.18927366@netrisk.com>
X-Deja-AN: 389422625
Content-Transfer-Encoding: 7bit
References: <35F56B62.E5611031@netrisk.com>
Content-Type: text/plain; charset=us-ascii
Organization: NetRisk Inc.
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing