Article View: borland.public.jbuilder.java.swing
Article #11622Re: Another JTable problem - Intercell Spacing
From: Max Polk
Date: Sat, 01 May 1999 00:00
Date: Sat, 01 May 1999 00:00
25 lines
1616 bytes
1616 bytes
In article <37296798.2367A59E@klein-und-partner.de>, friedritz@klein-und- partner.de says... > When changing the intercell spacing in a JTable, the selected table row > is displayed in a very ugly way. The data fields are highlighted, the > spaces aren't. > Does anybody know how to make JTable display everything in the same > color? I noticed the same thing. There's no way to avoid it, so simply don't set the intercell spacing to any larger than one or two. This makes the text cram up right next to the text in the next cell, so in my custom cell rendererer, I *ALWAYS* put three spaces at the beginning of the text. By *ALWAYS* placing three spaces at the beginning, the text isn't crammed up right next to the next cell's text. It looks good to me and satisfies my need for intercell spacing. Ultimately, you can set the row height and column widths to achieve the overall cell spacing you want. Use the cell renderer to position the text or graphics within so many pixels of the edge to give the "EFFECT" of intercell spacing. I agree with your original point -- the gaps of color are horrible.
Technical Details
Message-ID:
<MPG.119514d3d38686dc9896dc@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37296798.2367A59E@klein-und-partner.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,9da03b841aeb4ace X-Google-Attributes: gid111d45,public From: none@none.invalid (Max Polk) Subject: Re: Another JTable problem - Intercell Spacing Date: 1999/05/01 Message-ID: <MPG.119514d3d38686dc9896dc@forums.borland.com> X-Deja-AN: 472951756 References: <37296798.2367A59E@klein-und-partner.de> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing