Article View: borland.public.jbuilder.java.swing
Article #12937Cell rendering problem & solution
From: Vasudevan Srinivasan
Date: Fri, 23 Oct 1998 00:00
Date: Fri, 23 Oct 1998 00:00
12 lines
1009 bytes
1009 bytes
Hi, If you ever happen to write a custom cell renderer for jtable, jtree etc. extending it from jlabel, you might want to write setBackground & setForeground methods to distinguish betn selected & non selected components. usually only the setForeground() method works but not the setBackground(). this is because jlabel is non-opaque by default. just set it to true in the getXXXComponent method and the cell background will be properly colored. may be trivial, but trivial things may cost most of your time Vasu
Technical Details
Message-ID:
<3630A66A.FD738C5D@netrisk.com>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,56298054db94c410,start X-Google-Attributes: gid111d45,public From: Vasudevan Srinivasan <vasudevan@netrisk.com> Subject: Cell rendering problem & solution Date: 1998/10/23 Message-ID: <3630A66A.FD738C5D@netrisk.com> X-Deja-AN: 404320875 Content-Transfer-Encoding: 7bit Organization: NetRisk Inc. Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing