• Post Reply Bookmark Topic Watch Topic
  • New Topic

Selected JTable row is not empty

 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

May I know how do I find out if the selected JTable row is empty of values ?

When I do the following code:



I get the following exceptions:



The exception is too to list down here.

How do I do a check to ensure that the selected row is not empty so it doesn't throw an exception ?

Thanks.
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace you posted suggests that there was no selected row i.e. Table.getSelectedRow() returned -1.

And it's against convention to start a variable name with an uppercase letter. table, not Table.
 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Got it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!