Originally posted by illya figotin:
Sayuri:
Yes, I check for isSelected. But the end, any changes I've made will disappear, because JTable puts my JTextArea in the cell area, so it is still in the cell rectangle, and it doesn't look like JTextArea.
Could you please advise me something in this case?
Thanks.
Ilya.
Originally posted by Swamy Vatti:
Hi,
Can you give me some more info, the sequence of events...
Like after editing the cell, what do you do?
I had the same problem and now its working perfect.
Can you tell me what JDK version are you using?
Originally posted by Swamy Vatti:
Hi,
If you are doing some action, lets say button click, after updating the table, put this code in the action performed method.
int row = yourTable.getEditingRow();
int col = yourTable.getEditingColumn();
if (row != -1 && col != -1)
yourTable.getCellEditor(row,col).stopCellEditing();
I guess this should work perfect.
Originally posted by Swamy Vatti:
Then I guess the renderer is not picking up the value from the model.
In the getTableCellRendererComponent(Object value,....)
set the components text to the 'value' from the parameter.
ie TextField.setText(value.toString());
Originally posted by Swamy Vatti:
Hi,
This is because u dont have the implementation for the method setValueAt of TableModel.
Implement this method and I guess you should not be having any problems