🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Changin cell color in JTable

#12823
From: Jeff Wild
Date: Wed, 04 Nov 1998 00:00
32 lines
1857 bytes
In article <71nrtf$8iv2@forums.borland.com>, "Matt Krevs" <mattkrevs@flex.com.au> wrote:
>Check out the following link.
>http://java.sun.com/docs/books/tutorial/ui/swing/table.html
>
>It discusses many of the aspects of JTables.
>Basically you want to create your own table renderer class and set the
>background color based on your criteria.
>
This tutorial says that "a single cell renderer is used to draw all of the 
cells in a column."  Read that COLUMN.  It goes on to say "you [can] customize 
cell display and editing by specifying cell renderers and editors either by 
column or by data type."  The example in the tutorial pertains to 
formatting/editing an entire COLUMN.

What if I want to change the color of a single CELL in a COLUMN?  For 
instance, if I have a column of debits/credits, how do I display debits a 
different color than credits?

>Alberto Robles wrote in message <363F2A8D.D2D20E56@tecsidel.es>...
>>I've looking for a way to change one cell background colour in a JTable.
>>Does anyone succeed in changing it?
>>
>>Thanks
>>Albert
>>
>>--
>>--------------------------------------------------------------------
>>Alberto Robles | Contrary to popular belief, Unix is user friendly.
>> Tecsidel,S.A. | It just happens to be selective about who it makes
>>+34-93-2922110 | friends with.
>
>
Technical Details
Message-ID: <36406413.0@news3.uswest.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <363F2A8D.D2D20E56@tecsidel.es> <71nrtf$8iv2@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,dbd640fd7c418ab6
X-Google-Attributes: gid111d45,public
From: jwild@oriental.com (Jeff Wild)
Subject: Re: Changin cell color in JTable
Date: 1998/11/04
Message-ID: <36406413.0@news3.uswest.net>
X-Deja-AN: 408301442
X-Report: Report abuse to abuse@uswest.net.
References: <363F2A8D.D2D20E56@tecsidel.es> <71nrtf$8iv2@forums.borland.com>
X-Trace: 4 Nov 1998 08:26:27 +0600, 204.26.73.5
Newsgroups: borland.public.jbuilder.java.swing