View Single Post
Old Feb 16th, 2008, 12:50 AM   #1
namsu
Newbie
 
Join Date: Jan 2008
Posts: 15
Rep Power: 0 namsu is on a distinguished road
Netbeans and Password Field

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.
namsu is offline   Reply With Quote