aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Cell editors and Renderer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Cell editors and Renderer" Watch "Cell editors and Renderer" New topic
Author

Cell editors and Renderer

Eli Daum
Greenhorn

Joined: Jul 29, 2002
Posts: 12
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

Joined: Jan 30, 2002
Posts: 3451
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


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

"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!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Cell editors and Renderer
 
Similar Threads
CellRenderers and Decorator pattern
How to use TableCellRenderer for JButton.class
Reading excel file using java
Change the color of a JTable cell on mouse click
Focus on a specified cell