• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javafx nullPointerException

 
Cody Biggs
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So everything seems to be working, except for the show instructor and show student doesnt work..well half right at least. When I select show student and show instructor it suppose to return me the name of the instructor or student I am looking for. However it kills the program, and gives the nullPointExcetion error. This is what I have :

 
Norm Radder
Bartender
Posts: 1526
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gives the nullPointExcetion error

Please copy the full text of the error message and paste it here. It has important info about the error.
 
Cody Biggs
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


and heres the college class since it mentions that

 
Norm Radder
Bartender
Posts: 1526
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at edu.tridenttech.CPT237.javafx.program3.College.getStudentByName(College.java:88)
    at edu.tridenttech.CPT237.javafx.program3.Main$ShowTheStudent.handle(Main.java:182)

The line numbers don't match the posted code: line 88 is empty

Look at line 88 in the College class and find the variable with the null value.  Then backtrack in the code to see why it does not have a valid valid.
If you can't tell where the null value is by looking at the code, add a print statement  just before line 88 that prints the values of all the variables used on line 88 to show which one is null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic