title: Compare two JPasswordFields in Java before saving?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13460582/how-to-check-if-jpassword-field-is-null">How to check if JPassword field is null</a>  </p>
  </blockquote>
  
  
  
  <p>While creating a login registration form, I am using two password fields. Before saving the data, I want to compare both fields; and if they match, then the data should be saved in file.  If not it should open a dialog box. Please can anyone help me.</p>