Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

input dialog, password

807599Feb 23 2007 — edited Feb 23 2007
Is there a way when you start a program it prompts you to enter a username and if correct it contiunes running the rest of the program where my GUI will display. at the moment i am using this code and method but it does not work?

do
{
userName = JOptionPane.showInputDialog("Enter user name");
}

while ((userName == USER_NAME));

if (userName == USER_NAME)
{
System.runFinalization() ;
}

else
{
System.exit(0);

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2007
Added on Feb 23 2007
3 comments
74 views