I understand how to implement and use a password field, but when using the NetBeans IDE it becomes confusing because the logic does not work. I have tried many netbeans guides, many of them are too simple and do not go in depth with using GUI.
I have added a Password Field, and JButton. Now I set the actionPerformed event to the JButton and wrote this code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
char[] pass = jPasswordField1.getPassword();
char[] password = {'u'};
if(pass == password )
jTextField1.setText("Right");
else
jTextField1.setText("Wrong");
If someone could help me in this frustrating situation, it would be great. Thank you very much.