• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why always throw this exception on JTable?

 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My RecordTableModel class extends AbstractTableModel and get value from data access layer, when I execute table.setModel(model), it always throw this exception:


I don't know why this heppen?? Please help me!!

BTW: my table varible is class varibale....
 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your number of columns and number of fields (in data model) match? I got that before, it was caused by something like that, but I can't exactly remember ;/
[ October 10, 2004: Message edited by: Anna Kafei ]
 
Anna Hays
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replicated your error. It was


in your data model impl, the numberOfColumns is smaller than the columns you what to set in your JTable. It has to be >=
[ October 10, 2004: Message edited by: Anna Kafei ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic