wood burning stoves
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Non-default rendering of columns necessary ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Non-default rendering of columns necessary ?" Watch "Non-default rendering of columns necessary ?" New topic

Non-default rendering of columns necessary ?

Klaas van Gelder
Ranch Hand

Joined: Jul 08, 2004
Posts: 111

Hi all,

In my nearly completed GUI, I still use the default rendering. And because all fields are Strings, they are all shown in the same, left-aligned way.

I read here that many people use custom cell renderers to right-aliign some columns and show a currency sign in the price column.

My first question is: shound we really spend efforts on these rendering issues ? It is pretty complicated stuff to create and register your custom renderers, and not really trivial for junior users, who should after all be able to maintain the application... :-)

And my second, if i DO use a default renderer, i notice that the font is changed to bold ! This is the code I use now in my currency renderer:

It is copied from a tutorial, so dont look at the strange variable names.. :-)
But why does it show the currencies in bold ? And how can i choose the same font as the original field ?

Regards, Klaas
[ September 28, 2004: Message edited by: Klaas van Gelder ]

"What you don't know, can't help you"
SCJP (81%), SCWCD (81%), SCJD (354/400), SCBCD (85%)
Klaas van Gelder
Ranch Hand

Joined: Jul 08, 2004
Posts: 111

The extra line:

does the trick of making the font the same as the rest of the table !

Additional issue is that there is no space between the now right-alignment of the Price field and subsequent (left aligned) Day field. Maybe the JTextfield should get a right margin ?
I agree. Here's the link: http://aspose.com/file-tools
subject: Non-default rendering of columns necessary ?
It's not a secret anymore!