• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAVA: Trying to create checkboxes according to the number of rows in a text file  RSS feed

 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Here I am trying to generate checkboxes according to the number of details(rows) in a my text file. For an example, if there are five rows in the text file then five check boxes should generated. Here is my code


I have highligted the area where I am trying to create the check boxes. This code has no error at the compile but generates "NullPointException" in runtime. I can't find what is the error . The checkbox generating is at the last while loop. Please help me. Thanks



 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out line 241 - you are creating a local variable that shadows your field.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
COOL!!! Thanks a lot!
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!