Solved

getText() using UNIX

Posted on 1998-06-22
1
165 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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 105
java stored proc example 9 30
Error in @AspectJ Based AOP with Spring 2 13
Which non-HTML GUI front end to use with Java? 3 22
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

772 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