Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.alt.net!news-in-01.newsfeed.easynews.com!easynews.com!easynews!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "usenet" Subject: Re: JTable Cell Renderers Message-ID: <0T3kvafeIs4c@uni.chka.de> X-Comment-To: comp.lang.java.gui Newsgroups: comp.lang.java.gui In-Reply-To: <0f1b7cf8f0d7ec76c829829ae950f4f3@localhost.talkaboutprogramming.com> References: <0f1b7cf8f0d7ec76c829829ae950f4f3@localhost.talkaboutprogramming.com> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 31 Date: Wed, 27 Apr 2011 15:25:51 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303917951 96.60.20.240 (Wed, 27 Apr 2011 10:25:51 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:25:51 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:145 To: comp.lang.java.gui freesoft_2000 wrote: > I am currently trying to use a JTextPane as a cell > renderers for a JTable but it does not seem to work although the program > compiles. I alsways get an error stating class cast exception saying that > i must cast the editor component to JTextField instead of a JTextPane > although i am using a JTextPane as a cell renderer. Editor != Renderer Your general logic is also not clear: Changing the font of the editor will not have any permanent effects unless the font change is actually stored somewhere permanently (If it is supposed to be part of the data to be edited, in the TableModel). > Below is a small compilable that i have done which > compiles and throws the exception that i have mentioned about It is not directly compilable: The unused class CustomTableCellRenderer is missing, and your newsreader has wrapped lines so that comments have become code. Christian --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24