File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 19680
    
  19

How about showing us the stack trace?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable.setModel() method NullPointer Exception