Article View: borland.public.jbuilder.java.swing
Article #12874JTable row renderer
From: Jeff Wild
Date: Wed, 28 Oct 1998 00:00
Date: Wed, 28 Oct 1998 00:00
12 lines
1245 bytes
1245 bytes
I've seen this question asked before, but never adequately answered. Is it possible to render a JTable _row_ differently than other rows? For instance, say I have a single column table of numbers. If the number is negative, I want the background color to be red. If zero or positive, I want the background to be white. Is this possible? The Java Tutorial states that "...each column has a single cell renderer that draws all of its cells" and "you can specify different cell editors and renderers either by column or by data type." This suggests to me that I can render _columns_ differently, but not rows. Seems to me this is a real weakness with JTable.
Technical Details
Message-ID:
<36379479.0@news3.uswest.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,5685a453c894e7a6,start X-Google-Attributes: gid111d45,public X-Google-Thread: f5d71,5685a453c894e7a6,start X-Google-Attributes: gidf5d71,public From: jwild@oriental.com (Jeff Wild) Subject: JTable row renderer Date: 1998/10/28 Message-ID: <36379479.0@news3.uswest.net> X-Deja-AN: 406076610 X-Report: Report abuse to abuse@uswest.net. X-Trace: 28 Oct 1998 16:02:33 +0600, 204.26.73.5 Keywords: JTable, TableCellRenderer Newsgroups: borland.public.jbuilder.java.swing,comp.lang.java