adding rows to coloumns. Netbeans
Dear sir,
I am making simple GUI application in Netbeans6.5.
I want to add row through code during run time of program.
I have one jtable and one jbutton on the frame .
If i press jbutton then there should be addition of one row in the jtable for this i have added the following code in jbutton action performed function
Jtable.addRowSelectionInterval(0,jtable.getRowCoun t()-1);
But i am not able to achieve the task . the number of rows same as that were in the beginning i.e. number of rows are not increasing on pressing the jbutton
Also i have refreshed the jframe for that but still it doesn't work
Please tell me the solution for that.
regards
gaurav
Re: adding rows to coloumns
Hello haygaurav,
Sorry for the late reply.
Quote:
The row must be added to the TableModel, not the JTable as you are attempting.
add row in jTable use Netbeans. - Java
Appending a Row to a JTable Component (Java Developers Almanac Example)
I hope these links help to solve your problem.