posted 21 years ago
In JTable, there are two components used in every column.
1. Renderer :
Renderer is responsible for rendering the data and display it in the table. Default renderer extends from JLabel, You can write your own custom renderer to format data to whatever format you want it to be displayed. But, the underlying data is not changed.
2. Editor:
Editors are kind of wrapper around the actual editing component. Components can be anything extends from JComponent. Default editor is JTextField. You can create your own custom editor for your editing needs. If you edit the value in a cell and move focus to next cell/row, the value will be updated in the Model by the Editor.
(I am just telling this because you said you are new. If you already know it, please ignore it)
Ok.. here is the code for CustomDateCellRenderer
CustomDateEditor is little bit hard. If you like to have a it as a mask field, you have to write lots of code.. I can give you a skeleton only.
[ October 25, 2002: Message edited by: Sankar Subbiah ]