• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :-)
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great, thanks for the confirmation.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic