File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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: 231

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

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

Thanks a lot sir! Silly mistake on my part
I agree. Here's the link:
subject: NullPointerException with JTextField.getText
Similar Threads
Sending password/login info using sockets
Creating a login screen
My second frame will not open and my first will not close
What is wrong with my code?
My code does not run