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 code is:
out.println("mail from: " +From.getText());
I am also using the printWriter
What am I doing wrong?
Who is Participating?
evijayConnect With a Mentor Commented:
Please check if From variable is null before that statment


if (From == null) {
  System.err.println("From is null : logical problem need to be fixed!!");
  out.println("mail from : " + From.getText());
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.