String [] abcd={"A","B","C","D","E","F","G","H","I","J","K","L","N","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
JButton [] efgh = new JButton[abcd.length];
String [] secretWord={"S","W","I","N","G"};
JTextField [] input= new JTextField[secretWord.length];
String assign;
String [] content = new String[5];
for(int a=0;a<abcd.length;a++)
{
if(e.getSource()==efgh[a])
{
efgh[a].setEnabled(false);
if(i<input.length)
{
input[i].setText(abcd[a]);
i++;
if(i==input.length)
{
for(c=0;c<input.length;c++)
{
assign=input[c].getText();
content[c]=assign;
System.out.print(content[c]);
}
}
}
}
if(c==4)
{
if(content[0] == secretWord[0]) && content[1]==secretWord[1] && content[2]==secretWord[2] && content[3]==secretWord[3] && content[4]==secretWord[4])
{
output1.setText("You are right!!!!");
}
else
{
output1.setText("Try again!!");
}
}
}
when user click the button at all , i want to proceed the step content[value] with secretWord[value], but always got "Try Again".. where are the statement i have been wrong??please me thank you very much..