Article View: borland.public.jbuilder.java.swing
Article #7693Re: JTable CellRenderer Quetion
From: John McGrath TeamB
Date: Fri, 29 Dec 2000 18:09
Date: Fri, 29 Dec 2000 18:09
31 lines
1809 bytes
1809 bytes
On Thu, 28 Dec 2000 07:10:41 -0600, James A. Schulz wrote:
> Sorry to have bothered you with such a simple problem,
> but I am very new at this.
It's not a bother, as that is what we are here for, and we are all new
at something.
> my renderer does not seem to have any effect.
My guess is that you are not registering your TableCellrenderer
properly, so it is not being used. I noticed the following line in
your original post.
jTable1.setDefaultRenderer(null,
new MyCellRenderer(SwingConstants.CENTER));
The first argument to setDefaultRenderer() is the Class for which it
will be used. I took a quick glance at the code, and it looks like you
should get a NullPointerException when you execute this.
Is this the code you are currently using?
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.14b60c60bdb5b7b2989dfd@forums.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!sienna.impulse.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mailReferences:
<925vkp$luo7@bornews.inprise.com> <MPG.14b49e66609c4485989df1@forums.borland.com> <92fdv0$ohp7@bornews.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,78ede608538ed371 X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2000-12-29 10:10:14 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!sienna.impulse.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.swing Subject: Re: JTable CellRenderer Quetion Date: Fri, 29 Dec 2000 13:09:27 -0500 Organization: Another Netscape Collabra Server User Lines: 31 Message-ID: <MPG.14b60c60bdb5b7b2989dfd@forums.borland.com> References: <925vkp$luo7@bornews.inprise.com> <MPG.14b49e66609c4485989df1@forums.borland.com> <92fdv0$ohp7@bornews.inprise.com> NNTP-Posting-Host: dslcv1-60.fast.net X-Newsreader: MicroPlanet Gravity v2.30