Passing a password from login
I am using java frames to create a small project. In the login frame I
receive a username and password from the user. After checking for
validity, I must pass this username and password to another frame's
constructor (called UserFrame). I am passing as a string and it seems
unsecure. Is there a good method to achieve passing a password from one
frame to another in java?
String user=userField.getText();
String pwd= passField.getText();
if (user.equals("yourusername") && pwd.equals("yourpassword"))
Home x= new Home(user,pwd);
No comments:
Post a Comment