Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textfield empty or not? 1

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE

Hello,

how can I control if a textfield is empty or not??

please hurry!!!!!

thanx Me
 
Hi,

I think it would work better, if you do something like that (in Swing) :

JTextField textField = new JTextField (...);

...

// Test if empty
if (textField.getText ().length () == 0)
//or
if (textField.getText ().equals (""))
...

Bye

--
Globos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top