File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help with a simple login Gui Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with a simple login Gui" Watch "Help with a simple login Gui" New topic
Author

Help with a simple login Gui

James Hambrick
Ranch Hand

Joined: Sep 04, 2004
Posts: 282



I get compile errors saying "cannot find symbol txtUsername" Also cannot find txtPassword, username, or password.


Visit my blog! http://jameshambrick.com
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11499
    
  16

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:



There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
James Hambrick
Ranch Hand

Joined: Sep 04, 2004
Posts: 282

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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with a simple login Gui