This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable getValueAt null Exception

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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




 
K. Tsang
Bartender
Posts: 3348
12
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything particular wrong with the coding. How are you getting the values? From a table model or something else?
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Strange Error.png
[Thumbnail for Strange Error.png]
strange error 2.png
[Thumbnail for strange error 2.png]
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic