JTable & SetCellEditor
I have a JTable with data.how can i set the cellEditor to only first row (but for all the columns in the first row) here is the code i am using..
field=new JTextField();
int cols = table.getModel().getColumnCount();
int row = table.getModel().getRowCount();
int getFirstRow = table.getSelectedRow();
if(getFirstRow==0){
for(int i= 0; i< cols ;i++){
TableColumn col = table.getColumnModel().getColumn(i);
col.setCellEditor(new DefaultCellEditor(field));
}
}
Here ,I want to set a Text filed as the DefaultCellEditor so that I can further add a documentlistener to this Textfield for filtering functionality.The filter part is working though.
But when I use this code every cell in the Table has a cellEditor..but i want only the First row with all the columns to have a cellEditor..
Secondly ,When i enter some text for filtering rows,how can i avoid the data not to be shown on the first row. b'coz i exclusively want this row to be used for having inputs for the filtering rows. Please Help..

