• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with scope and class

 
Roger Wells
Ranch Hand
Posts: 51
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still having a hard time understanding scope and classes.

Here is a program I am working on and have a problem with on line 91.  Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at citationformatter.CitationFormatter.formatcitation(CitationFormatter.java:91)

I am trying to add content to the text area so that it can be formatted. I am sure it is some type of scope. I keep thinking that anything created Public should be available anywhere in the project but maybe not.

I have read and re-read the tutorials on classes but cannot get the hang of it. Maybe if I could just see and outline of the class I should be using.

I appreciate the patience and help
Thanks
Roger

 
Norm Radder
Bartender
Posts: 1526
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have a problem with on line 91. 
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at citationformatter.CitationFormatter.formatcitation(CitationFormatter.java:91)
The first thing you need to do is find the variable with the null value.  If you can't tell what variable is null, add a print statement just before the line where the exception happens that prints out the contents of the variables on the line where the exception happens.
When you find the variable that is null, backtrack in the code to see why it does not have a valid value.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic