Just wondering how I can take in the text from an array of JTextFields and check to see if their values are not = to "X" .
So far my code is :
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("nextP…
count++;
if(count == 1 || count == 3 || count == 5 || count == 7 || count == 9){
while (a<b){
if(text[a].getText() != "X"){
JOptionPane.showMessageDialog(nu… "Must use X only");
}
}
}
nextPlayer is a button
and the while a<b is just a loop to go through the array of text fields called text[]
Thanks,
Disco


Sign In
Create Account

Back to top









