Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JTable based on objects not updating when object values are changed

  Asked By: Kenneth    Date: Oct 01    Category: Java    Views: 1391
  

The way my program works is:

1. Create Object[][] of cell values (all Strings) from a list of
Profile objects.
2. Create String[] of column names
3. profilesTable = new JTable(new DefaultTableModel(data, columnNames)
{ public boolean isCellEditable(int row, int column) { return false; }
});

Whenever I modify a profile (modification takes place in a seperate
window), the value in the table does not change. I thought it would,
since technically the same String object that was just changed is the
same string object that was passed to the table initially.

I've tried calling repaint() and
((DefaultTableModel)profilesTable.getModel()).fireTableCellUpdated
(row,
col);
but neither makes a difference.

Why does it not update?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 




Tagged: