Article View: borland.public.jbuilder.java.swing
Article #7798Re: JTable CellRenderer Quetion
From: James A. Schulz
Date: Sat, 30 Dec 2000 13:57
Date: Sat, 30 Dec 2000 13:57
33 lines
2306 bytes
2306 bytes
John, Thanks. Passing Object.class did the trick. James "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.14b79eaf70898fc4989e06@forums.borland.com... > 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:
<92kpe7$avr4@bornews.inprise.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!news.stealth.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> <MPG.14b60c60bdb5b7b2989dfd@forums.borland.com> <92is13$fef7@bornews.inprise.com> <MPG.14b79eaf70898fc4989e06@forums.borland.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 05:59:25 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!newsfeed.mesh.ad.jp!news.stealth.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail From: "James A. Schulz" <jaschulz@wiseware.com> Newsgroups: borland.public.jbuilder.java.swing Subject: Re: JTable CellRenderer Quetion Date: Sat, 30 Dec 2000 07:57:15 -0600 Organization: Another Netscape Collabra Server User Lines: 35 Message-ID: <92kpe7$avr4@bornews.inprise.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> <MPG.14b79eaf70898fc4989e06@forums.borland.com> Reply-To: "James A. Schulz" <jaschulz@wiseware.com> NNTP-Posting-Host: 165.121.198.13 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200