How can I add rows in a JTable dynamically?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Carlos_Caraccioli
Posted On:   Friday, November 29, 2002 06:15 PM

I am using the JTable component. I see there is a method called addColumn but I don't see a method for adding rows. I want to know if there is an "addRow" method or something like that or a way to do add rows in a dynamic way.

Re: How can I add rows in a JTable dynamically?

Posted By:   Doug_H  
Posted On:   Wednesday, December 11, 2002 02:16 PM

Hi, try something like:
jtable.getModel().insertRow( int row, Object[] or Vector )
see:
http://java.sun.com/products/jfc/swingdoc-api-1.1.1/javax/swing/table/DefaultTableModel.html
http://javafaq.nu/java/free-swing-book/free-swing-book-chapter18.shtml
About | Sitemap | Contact