Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with a simple login Gui

 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I get compile errors saying "cannot find symbol txtUsername" Also cannot find txtPassword, username, or password.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12198
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
txtUsername is declared inside the go() method. if you are not in that method, the variable doesn't exist. Same for the others.

you probably want to declare them as member variables, then set them inside your go() method... something like:

 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that worked, I also rename username to strUsername and password to str Password(thinking they were reserved words). And changed txtUsername.setText = ""; to
txtUsername.setText("");

Now it runs yea!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic