Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a problem that need anyone help.
I hava a Jtable data and now I want to add new row or delete a row or multi row,
when I add new,data on screen is not added but when I click on anycell and edit them, new row is appear,when I debug code, i saw exception at command Add.Message Error "ArrayIndexOutofBoundException"
C#
Vector<Object> obj = new Vector<Object>("","","","","","");
obj.set(0, dataTable.getRowCount()+ 1);
model = (M6VariableTableModel) dataTable.getModel();
model.addRow(obj);


and for Delete te same.
please help me!

thanks in advance!
Posted

1 solution

Check the following links :

http://www.exampledepot.com/egs/javax.swing.table/AppendRow.html[^]

http://www.exampledepot.com/egs/javax.swing.table/InsertRow.html[^]

It seems that addRow may have problems with a Vector
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900