wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes NullPointerException with JTextField.getText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "NullPointerException with JTextField.getText" Watch "NullPointerException with JTextField.getText" New topic
Author

NullPointerException with JTextField.getText

Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 234
    
    1

For some reason, a NullPointerException is thrown in the saveInfo() method which tries to save the text from the text fields once the sign in button is clicked.

Here are my two files:



Main method:
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Line 51 to 53, you're shadowing your instance variables with local variables.


[My Blog]
All roads lead to JavaRanch
Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 234
    
    1

Thanks a lot sir! Silly mistake on my part
 
Don't get me started about those stupid light bulbs.
 
subject: NullPointerException with JTextField.getText