• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cell editors and Renderer  RSS feed

 
Eli Daum
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot get clear info as to when it is correct to use a CellRenderer object or a cellEditor object (for adding a JLabel to a JTable cell). Is there any difference what you use?? Do you need both objects??
Does an editor edit the cell at construction only?
Please reply ASAP
Thanks elid
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi elid,
First off you need to change your display name to a first and last name as is the policy here at JavaRanch.
Cell editors are just that: they give you control on what the user enters into a cell and exist through the life of the table. Cell renderers render or "draw" the cells and also live as long as their table. If you don't supply editors or renderers then the default for the particular type of component that occupies the cell will be used.
Hope this clears it up,
Michael Morris
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"SeventhWonder" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!