• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
Master Rancher
Posts: 3260
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!