Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
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
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:35 PM.

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