Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable.setModel() method NullPointer Exception

 
dinesh kumar s
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

stuck in the JTable.setModel().

trying to create a model and passing a arraylist.

but getting the null pointer exception in the setModel()

please let me know what is wrong in the code i have created.

Thanks



 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are getting NullPointerException probably because you didn't instantiate your JTable (or at least I can't see it in the code you posted) so it's actually null.
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about showing us the stack trace?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic