This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with scope and class  RSS feed

 
Ranch Hand
Posts: 70
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

 
Rancher
Posts: 3066
33
  • 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.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!