aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable getValueAt null Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable getValueAt null Exception" Watch "JTable getValueAt null Exception" New topic
Author

JTable getValueAt null Exception

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601

I don't know why this line
throws null exception.
String email = t.getValueAt(i, 5).toString();




K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2505
    
    8

I don't see anything particular wrong with the coding. How are you getting the values? From a table model or something else?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601
K. Tsang wrote:I don't see anything particular wrong with the coding. How are you getting the values? From a table model or something else?


I directly input those values into the table
The table was created by netbeans first.
And I wasn't happy about it, but it shouldn't be a problem
There is a same problem with
I tried to add another dummy column to both
of these models to no avail, but email and Price are null when inputted samples like
1234@yahoo.com.cn and 1000



[Thumbnail for Strange Error.png]

[Thumbnail for strange error 2.png]

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601
I guess the project is pointing at the wrong source.
Try to figure it out.
All the corrections have no effect on the output
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601
Jacky Luk wrote:I guess the project is pointing at the wrong source.
Try to figure it out.
All the corrections have no effect on the output


No, don't know what the damn is going on
Have to demo tomorrow.
Thanks
Jack
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 601
Jacky Luk wrote:
Jacky Luk wrote:I guess the project is pointing at the wrong source.
Try to figure it out.
All the corrections have no effect on the output


No, don't know what the damn is going on
Have to demo tomorrow.
Thanks
Jack


It seems to be an oracle bug to me
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Jacky Luk wrote:

Your table initially contains nothing but null values. If you don't change those values then of course getValueAt will return null.


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 getValueAt null Exception