Solved

Jtextfield

Posted on 1998-09-04
1
147 Views
Last Modified: 2010-03-30
I am trying to do the following
  if(tx1 = = null){
    tx1.setText(String.valueOf(0));
it doesn't work, is there a better way to do this?
0
Comment
Question by:psteph
1 Comment
 

Accepted Solution

by:
tarlton earned 50 total points
ID: 1223602
What you want to do is this:

if ( tx1.getText().equals("") )
{
   // Do some stuff
}
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
runtime exception 2 50
servlet and mdb, jms error 1 54
glassfish admin console 1 17
Strange router problem - can't access hotmail.com 14 37
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…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

740 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