• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

getText() using UNIX

I am creating a java program that connects to the SMTP server, also using GUI  I am trying to use the getText feature to use the  information inputted by the user to the server.  I am getting a NullPointer Exception...mu code is:
out.println("mail from: " +From.getText());
I am also using the printWriter
What am I doing wrong?
0
ritson
Asked:
ritson
1 Solution
 
evijayCommented:
Please check if From variable is null before that statment

ie.,

if (From == null) {
  System.err.println("From is null : logical problem need to be fixed!!");
  System.exit(1);
}
else
  out.println("mail from : " + From.getText());
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now