Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   Netbeans and Password Field (http://www.programmingforums.org/showthread.php?t=15196)

namsu Feb 16th, 2008 1:50 AM

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.


All times are GMT -5. The time now is 4:09 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC