The explanation of Editor and renderer on the official website of Sun is as follows:
Renderer:
INSTEAD, A SINGLE
cell renderer is generally used to draw all of the cells that contain the same type of data. You can think of the renderer as a configurable ink stamp that the table uses to stamp appropriately formatted data onto each cell. When the user starts to edit a Cell's Data, A
Cell Editor Takes over the Cell, Controlling The Cell's Editing Behavior.
Personal understanding is to display different formats for different data, which is equivalent to selecting different views in MVC, rendere is the right to give you this choice. The display mode of the default data is as follows:
Boolean - rendered with a check box Number -. Rendered by a right-aligned label Double, Float -. Same as Number, but the object-to-text translation is performed by a NumberFormat instance (using the default number format for the current locale .) Date - rendered by a label, with the object-to-text translation performed by a DateFormat instance (using a short style for the date and time) ImageIcon, Icon -. rendered by a centered label Object -. rendered by a label That Displays The Object's String Value. If you have special data, you want to have a special display method, you can set your own Cell RENDERER as follows: TableCellrenderer weirdreer = new weirdreere (); table = new jtable (...) {public TableCellrenderer Getcellrenderer (INT Row, Int Column) {IF ((ROW == 0) && (Column == 0)) {Return WeirdRenderer;} // else ... Return Super.getcellrenderer (Row, Column);}}; editor It is used to edit data, but rendere is used to display data. About Editor, and Renderer abide by the same law