I need information on using ComboBoxes as Tablecolumns of JTable. The requirement is like below the TableHeader which has columns combo boxes should appear.That is first row of table should contain combo boxes which contains all values of that column. So that user can filter by selecting the value or entering some search criteria. It is similar to excel format where user can pick values from list.
Could anyone post some sample code or links where such examples or tutorials describes about comboboxes usage as I require.
Originally posted by Mohammed Ajmal: The requirement is ... below the TableHeader ... combo boxes should appear. That is first row of table should contain combo boxes which contains all values of that column.
Presuming that subsequent rows should not have these combo-boxes, then you must create a TableCellEditor that returns the combo box editor when the row parameter is zero in its getTableCellEditorComponent(), and for other rows returns the "regular" cell editor component.
This is because JTable keeps track of cell editors for an entire column. There's no way to say "use this editor for row X but this editor for row Y" except by doing something like this in getTableCellEditorComponent().
Depending on what you want, you may have to do something similar with the cell renderers, too.