Add a row in JTable
I have created the table with 4 colums and a single row.
I have too three text box.
When the user enter the Text in text box and click the add button .
The data should be added in new row of the table..
What should i do for that?
Thanks for your help..
The key here, I think is to use the right table model. I'd recommend that you use a DefaultTableModel object as your table's model, and that you call its addRow(Vector v) method when you want to add data to the bottom of your JTable. It should update the GUI automatically.
I could n't call method addrow from my table object..
By which object,I can call this method?
I was not able to understand it.
Which language is it?
As I mentioned above, the key is the table model you use, not the table. You use a DefaultTableModel as your model, set the JTable's model to this object, and then add rows by calling addRow on the table model object. Please have a look at the DefaultTableModel API, and all of your questions will be answered.