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 getValueAt null 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 getValueAt null Exception" Watch "JTable getValueAt null Exception" New topic
Author

JTable getValueAt null Exception

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590

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: 2247
    
    7

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
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 590
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: 590
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: 590
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: 590
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: 19656
    
  18

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
 
wood burning stoves
 
subject: JTable getValueAt null Exception
 
Similar Threads
ListSelectionListener got fired twice (mousePressed and mouseReleased)
Jtable CellEditor
actionevent in jcombobox of jtable
JTable numeric validation
Tab order in JTable