> I have put a JTable in my JFrame to get some data from user using
> it.There is also a JButton that
> I read table cells (with DeafultTableModel.getValueof(i,j)) when user
> clicks on it.But the proble is that
> when user changes contents of a cell and focus is still on that cell ,
> if user presses the button , data of that cell isn't updated.
The problem is, that in this case the cell editor's stopCellEditing()
method is not called. See also the API doc of CellEditor#stopCellEditing()
> Is any way to solve it?
In your JButton's action code you have to call stopCellEditing():
JTable yourTable = ...;
if (yourTable.isEditing()) {
yourTable.getCellEditor().stopCellEditing();
// may be you should also check the return value
}

Signature
Thomas