Username and password check not working. Eclispse GUI

时间:2016-02-12 20:32:49

标签: java

I have a GUI in eclipse where I enter username and password and if they are correct when I press a Jbutton, the GUI should close. Else say "Wrong username and password". My code is:

https://www.virendrachandak.com/techtalk/php-isset-vs-empty-vs-is_null/

I keep getting the "Wrong username or password" although the username and password are 100% correct. Where am I going wrong?

Variables: private JPasswordField Password; private JTextField username;

if(name == username.getText() && pass == Password.getText()){
                    //allow access
                    System.exit(0);
                }
                else{
                    //deny
                    btnLogIn.setText("Wrong username or password");
                }

0 个答案:

没有答案
相关问题