Adding a row to a jTable

Hi experts,

Apologies, this is probably a simple question but I am trying to figure out how to add a row to my pre-existing jTable "jTableOrders" when a listener gets the details.

There seems to be a method jTableOrders.addColumn() but no .addRow()

I can create the table with many blank rows and use .setValueAt(...) but I would prefer the displayed rows to float with the data (ie the table display only populated rows).

Please, how do you do it?

[479 byte] By [DrewDigglera] at [2007-11-27 10:10:14]
# 1
check this link http://www.codetoad.com/java_JTable.asp
AnanSmritia at 2007-7-13 0:46:58 > top of Java-index,Java Essentials,New To Java...
# 2
use DefaultTableModel...DefaultTableModel model = (DefaultTableModel)table.getModel();model.addRow(new Vector());
Yannixa at 2007-7-13 0:46:58 > top of Java-index,Java Essentials,New To Java...
# 3
Terrific!Thank you Anan! It seems I need to get a grasp of vectors.I'm trying it now and will let you know how I get on.:)
DrewDigglera at 2007-7-13 0:46:58 > top of Java-index,Java Essentials,New To Java...
# 4
Thanks Yannix and Anan,Using the example and combining with the short-cut did the trtick! My jTable is now operational!Thank you guys very much indeed!:)
DrewDigglera at 2007-7-13 0:46:58 > top of Java-index,Java Essentials,New To Java...