954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

can't compate text field?

I am trying 2 write a program to solve a soduko.
I have lots of text fields and I need to compare them like
if (string1.equals(textfield){ do whatever}

but it only works for "0" e.g null??/
I have tried parsing it to an int but get the same result.
any ideas

ultimate_fusion
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Try using this:
String value = myTextField.getText();

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

I thought I tried that but I got it to work cheers mate, he's what I was using for anyone with the same problem
String mydata = numberGrid[j].getText();

if (mydata.equals("1")){
}

ultimate_fusion
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You