Article View: borland.public.jbuilder.java.swing
Article #7697Re: JTable CellRenderer Quetion
From: John McGrath TeamB
Date: Sat, 30 Dec 2000 12:31
Date: Sat, 30 Dec 2000 12:31
24 lines
1897 bytes
1897 bytes
On Fri, 29 Dec 2000 14:29:06 -0600, James A. Schulz wrote:
> Yes, this is what I am currently using (and I do not see
> the null pointer exception you describe).
That is odd, since it seems pretty certain from the source code that it
should. What Java version are you using?
Nevertheless, you are telling the JTable that it should use your custom
TableCellRenderer for rendering a cell in a column whose column class
is *null*. So I presume that it is not using your renderer.
You need to make sure that getColumnClass() for your TableModel returns
the appropriate class, and then pass that class to setDefaultRenderer()
as the first argument. Alternatively, you could leave getColumnClass()
as is and pass Object.class to setDefaultRenderer().
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.14b79eaf70898fc4989e06@forums.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!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> <MPG.14b60c60bdb5b7b2989dfd@forums.borland.com> <92is13$fef7@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-30 04:31:58 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!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: Sat, 30 Dec 2000 07:31:40 -0500 Organization: Another Netscape Collabra Server User Lines: 25 Message-ID: <MPG.14b79eaf70898fc4989e06@forums.borland.com> References: <925vkp$luo7@bornews.inprise.com> <MPG.14b49e66609c4485989df1@forums.borland.com> <92fdv0$ohp7@bornews.inprise.com> <MPG.14b60c60bdb5b7b2989dfd@forums.borland.com> <92is13$fef7@bornews.inprise.com> NNTP-Posting-Host: dslcv1-60.fast.net X-Newsreader: MicroPlanet Gravity v2.30