Simple jTextField Question
Hi,
I've a really simple bit of code and cannot figure out why it won't work.
All I basically want this to do is take the text entered into the jTextField, if it matches a certain word, a response to be printed in the jLabel,
(for instance here if someone enters 'hello', it to return 'welcome').
For some reason that I can't work out, all it responds with is the else statement. All I am thinking is its something to do with using a String in a boolean statement, but I'm quite confused.
privatevoid jButton1MouseClicked(java.awt.event.MouseEvent evt){
value = jTextField1.getText();
if (value=="hello"){
jLabel1.setText("welcome");
}
else
{
jLabel1.setText("Please enter a valid word");
}
Thanks

