This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable.setModel() method NullPointer Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable.setModel() method NullPointer Exception" Watch "JTable.setModel() method NullPointer Exception" New topic
Author

JTable.setModel() method NullPointer Exception

dinesh kumar s
Greenhorn

Joined: Jul 09, 2012
Posts: 2
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

Joined: Jun 19, 2010
Posts: 825
    
    5

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.


The quieter you are, the more you are able to hear.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

How about showing us the stack trace?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JTable.setModel() method NullPointer Exception
 
Similar Threads
ArrayList of ArrayList<String>
NDimensionalBoolean
Sorting Of Array From Even Number To Odd Number
Passing Database query results through a method to a JTable
"Exception in thread "main" java.lang.OutOfMemoryError"