This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
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 Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "NullPointerException with JTextField.getText" Watch "NullPointerException with JTextField.getText" New topic

NullPointerException with JTextField.getText

Joel Christophel
Ranch Hand

Joined: Apr 20, 2011
Posts: 241

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é

Joined: Nov 24, 2005
Posts: 14688

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: 241

Thanks a lot sir! Silly mistake on my part
I agree. Here's the link:
subject: NullPointerException with JTextField.getText