Article View: borland.public.jbuilder.java.swing
Article #8724Re: Colored Rows in JTable.
From: John P. McGrath
Date: Tue, 25 Jul 2000 00:00
Date: Tue, 25 Jul 2000 00:00
24 lines
1285 bytes
1285 bytes
On Mon, 24 Jul 2000 11:59:07 +0200, Andreas Schnell wrote:
> you have to implement your own TableCellRender like this one,
> this works very fine.
>
> private class MyTableCellRenderer implements TableCellRenderer
> {
> :
> :
This approach will work in some cases, but it will defeat some of the
smarts in the default table cell renderer, so numbers will be left
justified rather than right and icons will display the results of their
toString() method rather than the image. It will also not work if you
have already specified a custom renderer for a column or column class.
Overriding prepareRenderer() should leverage all of the functionality of
the existing renderers. It lets the renderer do its thing, and it just
changes the background color.
--
Regards,
John McGrath
Technical Details
Message-ID:
<MPG.13e6f6d364e1d537989a6b@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39786dcb$1@dnews> <397c1137$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,bdd9f7380b70666 X-Google-Attributes: gid111d45,public From: John P. McGrath <JPMcGrath@fast.net> Subject: Re: Colored Rows in JTable. Date: 2000/07/25 Message-ID: <MPG.13e6f6d364e1d537989a6b@forums.borland.com> X-Deja-AN: 650455390 References: <39786dcb$1@dnews> <397c1137$1_1@dnews> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing