This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding new columns and rows to JTable  RSS feed

 
Simran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I want to add some rows or some columns to existing JTable and this the method which I'm using and calling this method when add button is pressed in the frame which contains JTable.
public ListSelectionModel setModel()
{
this.getSelectionModel();
int iMax = selectionModel.getMaxSelectionIndex();
int newMax = iMax + 10;
selectionModel.addSelectionInterval(iMax, newMax);
repaint();
return selectionModel;
}
Can anybody tell me how you can add new rows and columns to JTable.
Thanks.
Simran
 
selvas kumars
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In DefaultTableModel class you can find methods for adding
row,columns for the table..
selva.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!