Solved

getText() using UNIX

Posted on 1998-06-22
1
163 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now