Jtextfield

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?
pstephAsked:
Who is Participating?
 
tarltonConnect With a Mentor Commented:
What you want to do is this:

if ( tx1.getText().equals("") )
{
   // Do some stuff
}
0
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.