🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11556

Re: JTable cell formatting

#11556
From: Mike Wolterink
Date: Wed, 05 May 1999 00:00
26 lines
1786 bytes
Thanx all,
it works fine, except for the selectionbar !  ;-)
when I select this row, this double column (new renderer) doesn't show the
selectionbar.
I tried to set the colors, but it doesn't work ?! (the renderer inherits
from JLabel)
I read the background of JLabel cannot be set other than white;
so I have to paint it myself !?

any idea ?

Mike


Christian Kaufhold wrote in message ...
>In comp.lang.java.gui Mike Wolterink <m.wolterink@nedap.nl> wrote:
>> I want to 'format' my Double that I put in the JTable,
>> i.e.:   400.3000000  becomes 400.3 (I don't want that !!!)
>> I want to give a precision to the Double (400.30).
>> When I make a String of it, it aligns to the left and I don't want that
>> either !
>
>Use a custom TableCellRenderer, and have a look at java.text.NumberFormat/
>java.text.DecimalFormat to format your numbers.
>
>Christian
Technical Details
Message-ID: <7goq3d$mgb$1@news.worldonline.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7gmp1e$opi$1@news.worldonline.nl> <t61ng7.uf.ln@nandus.uni-bremen.de>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,61d4beeaae1dc2c3
X-Google-Attributes: gid111d45,public
X-Google-Thread: 10a146,61d4beeaae1dc2c3
X-Google-Attributes: gid10a146,public
X-Google-Thread: 10fd6d,61d4beeaae1dc2c3
X-Google-Attributes: gid10fd6d,public
From: "Mike Wolterink" <m.wolterink@nedap.nl>
Subject: Re: JTable cell formatting
Date: 1999/05/05
Message-ID: <7goq3d$mgb$1@news.worldonline.nl>
X-Deja-AN: 474225127
References: <7gmp1e$opi$1@news.worldonline.nl> <t61ng7.uf.ln@nandus.uni-bremen.de>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-Complaints-To: abuse@worldonline.nl
X-Trace: news.worldonline.nl 925887405 23051 195.241.227.220 (5 May 1999 06:56:45 GMT)
Organization: WorldOnline News server
NNTP-Posting-Date: 5 May 1999 06:56:45 GMT
Newsgroups: borland.public.jbuilder.java.swing,comp.lang.java.gui,comp.lang.java.programmer