• Post Reply Bookmark Topic Watch Topic
  • New Topic

actionPerformed method for JTextField not working  RSS feed

 
John J Smith
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I made a program to see how JTextField works.However,the contents inside the actionPerformed method of class FieldListener do not get executed when I press enter.



Can anyone explain what's wrong with the code?
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Don't use the == operator to find out whether the contents of two String objects are the same. That isn't what it's for. you should use the equals() method for that.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!