Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

JPasswordField not working

$
0
0
What im doing work :whatsthat:



bt1.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent ae) {
                char[] input = password.getPassword();
                char[] correctPass = {'H','I'};
                
                if(input == correctPass)
                {
                    JOptionPane.showConfirmDialog(null, "Correct password");
                }
            }    
        });





View PostChrisangel29, on 28 January 2013 - 03:55 PM, said:

What im doing work :whatsthat:/>



bt1.addActionListener(new ActionListener()
        {
            @Override
            public void actionPerformed(ActionEvent ae) {
                char[] input = password.getPassword(); // password is my JPasswordField
                char[] correctPass = {'H','I'};
                
                if(input == correctPass)
                {
                    JOptionPane.showConfirmDialog(null, "Correct password");
                }
            }    
        });




Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>