Solved

getText() using UNIX

Posted on 1998-06-22
1
167 Views
Last Modified: 2010-04-16
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
Comment
Question by:ritson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
evijay earned 100 total points
ID: 1223526
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question