Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Non-default rendering of columns necessary ?

 
Klaas van Gelder
Ranch Hand
Posts: 111
Java Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Klaas van Gelder
Ranch Hand
Posts: 111
Java Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic