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
Joined: Jul 08, 2004
The extra line: testLabel.setFont(table.getFont());
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 ?
subject: Non-default rendering of columns necessary ?