title: Passing a password from login
body: <p>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?</p>
  
  <pre><code>String user=userField.getText();
  String pwd= passField.getText();
  if (user.equals("username") &amp;&amp; pwd.equals("password"))
        Home x= new Home(user,pwd);
  </code></pre>