Copy data from one JTable to another JTable.

Isn't there an easy way to copy the content from one JTable to another JTable?Both tables have the same columns. The one may not refere to the other, as they later on should be able to be different.
[213 byte] By [EikHorsa] at [2007-11-26 12:20:20]
# 1

You make changes to a table's data via making changes to its TableModel - so it might depend on what you're using for the TableModel. Just get the model from the source JTable, make a new one from that and use that as the target's TableModel.

Hope that made sense

Good luck

Lee

tsitha at 2007-7-7 15:10:19 > top of Java-index,Archived Forums,Socket Programming...
# 2
I was thinking more of something with extracting a data-vector from the original one and copy it to the other.But perhabs the Tablemodel is the way to go?
EikHorsa at 2007-7-7 15:10:19 > top of Java-index,Archived Forums,Socket Programming...
# 3
That "data vector" is most likely the TableModel. Check out the tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#data
tsitha at 2007-7-7 15:10:19 > top of Java-index,Archived Forums,Socket Programming...