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
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 277



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: 9939
    
    6

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:



Never ascribe to malice that which can be adequately explained by stupidity.
James Hambrick
Ranch Hand

Joined: Sep 04, 2004
Posts: 277

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
 
Similar Threads
please can someone help me password my Java program!
Help with Chat software
Checking input in Dialog box before closing
Problem with default Submit
How do you add image in a JLabel?