• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any concerns with using the same cell renderer object for a number of cells?

 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a number of cells which are Dates and need to have them appear in the same format.
The samples I have seen usually create a new cell renderer object for each cell, even if its the same type.
Since I have a number of Date cells I thought it best to use a single object for each of the date cells, but after seeing the different samples I am wondering if there is something I may be missing where using the same cell renderer object could potentially be an issue.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that's fine. I guess I looked at different sample code -it never occurred to me one might use a separate renderer object for the same kind of cell :-)
 
Brett Spell
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tom Landry wrote:The samples I have seen usually create a new cell renderer object for each cell, even if its the same type.


Then I'd look for a different source of sample code; creating a new renderer for each cell is inefficient and completely unnecessary.

Tom Landry wrote:I thought it best to use a single object for each of the date cells, but after seeing the different samples I am wondering if there is something I may be missing where using the same cell renderer object could potentially be an issue.


No, you're absolutely correct. Renderers are meant to be used to draw multiple cells of the same type.
 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great, thanks for the confirmation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic