Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting new Row In JTable Problem  RSS feed

 
M Farooq
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am having problem while inserting a new Row into JTable.

i have my JTable in A Class while in B Class i only have its referance but
when i tries to access addRow method of jTable.getModel function, i recieve an error.

please suggest what should i do to resolved this problem.
Thank in advance.

regards,
softlogic
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch! It makes it really hard to help when you say you are receiving an error message but fail to show us that error message. Please Tell The Details.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you casting the result of getModel to DefaultTableModel?
Because TableModel itself does not have a method called addRow. And why should it? Not all table models need this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!