• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating custom renderers question ???  RSS feed

 
majid nakit
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I got confused about rendering cells of a jtable, my question is do we have the coice to implement the TableCellRenderer interface or to extend Swing's DefaultTableCellRenderer class ? if not when we have to use each of them ?
thank you, I appreciate your helps.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DefaultTableCellRenderer implements TableCellRenderer, so you can use either one. For most things it's easier to just make a subclass of DefaultTableCellRenderer. If you need to make big changes, then you can start with just the TableCellRenderer interface and implement everything yourself.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!