JTable: Update Value
Posted on 2006-10-23
I have created JTree using Arraylist. So Left side is JTree and when I pick the node it display its content to right side in JTable. In the Table there are 5 colunms. 2 columns are JComboBox.
I have created JTable like this:
model = new DefaultTableModel(data, columns);
table = new JTable(model)
public void setValueAt(Object value, int row, int col)
data[row][col] = value;
// I add new Row like this
if(e.getSource() == AddNewRow)
// add to array list
Everything is working fine but the only problem is The value that I change does not update right away.
When I select another node and go back to the previous node I see all the value that I have changed.
Can you please show me how to make this thing work?