Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help on TableModel  RSS feed

 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you create an empty table by passing in the tablemodel as an argument to the JTable? In other words, how do you initialize the Object[][] rowData field?
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rudy,
for empty table pass the following as tabledata.
Object tblData[][] = new Object[0][0];
TableModel tblmodel = new DefaultTableModel(lblData,colNames)

regards
deeksha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!