Change data in jTable

Hi,

I need to change data in a jtable using default table model.

But the following piece of code just doesn't change the table content. The j table is contained in a scroll panel. Can someone point me to the right direction to debug the problem? Thanks,

Object[][] newTableData = { {"5","6","7","8"}, {"AA", "BB", "CC", "DD"} };

String[] ColumnHeaders = {"Title", "Rating", "Date", "Genre"};

jTableMovies = new JTable(newTableData, ColumnHeaders);

[488 byte] By [w-wa] at [2007-11-27 4:00:55]
# 1
TableModelListener
filestreama at 2007-7-12 9:05:34 > top of Java-index,Java Essentials,Java Programming...
# 2

In the future, Swing related questions should be posted in the Swing forum.

I don't understand the context of your question. It seems like you have an existing table and want to update it with new data. If this is what you are trying to do, then there is no need to create a new JTable. You just create a new DefaultTableModel and then use the table.setModel(...) method to refresh the existing table.

camickra at 2007-7-12 9:05:34 > top of Java-index,Java Essentials,Java Programming...