title: getText() vs getPassword()
body: <p>I'm currently designing a login system for a make-believe company, right now all I have is the Main login, which needs a lot of cleaning up. Below is my login handler.</p>
  
  <pre><code>private class LoginButtonHandler implements ActionListener {
      public void actionPerformed(ActionEvent e) {
          if(_uid.getText().equalsIgnoreCase("Nathan") &amp;&amp; _pwd.getText().equals("password")) {
              JOptionPane.showMessageDialog(null, "Congratulations on logging in!");
          } else {
            JOptionPane.showMessageDialog(null, "Error on login!");
          }
      }
  }
  </code></pre>
  
  <p>As is, this works perfectly fine, but when I change it to</p>
  
  <pre><code>_pwd.getPassword.equals("password")
  </code></pre>
  
  <p>it directs straight to the else statement when everything is input correctly.
  What is wrong here? Full program below.</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class Main extends JFrame {
      private static final int HEIGHT = 90;
      private static final int WIDTH = 400;
  
      JTextField _uid = new JTextField(10);
      JPasswordField _pwd = new JPasswordField(10);
      JButton _login = new JButton("Login");
      JButton _reset = new JButton("Reset");
  
      public Main() {
         super("Login - Durptech");
          Container pane = getContentPane();
          setLayout(new FlowLayout());
  
          add(new JLabel("User ID:"));
              add(_uid);
          add(new JLabel("Password:"));
              add(_pwd);
  
              add(_login);
                  _login.addActionListener(new LoginButtonHandler());
              add(_reset);
                  _reset.addActionListener(new ResetButtonHandler());
  
          /*if(_uid.getText().equals("") &amp;&amp; _pwd.getText().equals("")) {
              _login.setEnabled(false);
          } else {
              _login.setEnabled(true);
          }*/
  
         setSize(WIDTH, HEIGHT);
         setResizable(false);
         setLocation(500, 300);
         setDefaultCloseOperation(EXIT_ON_CLOSE);
         setVisible(true);
      }
  
      private class ResetButtonHandler implements ActionListener {
          public void actionPerformed(ActionEvent e) {
              _uid.setText("");
              _pwd.setText("");
              _uid.requestFocusInWindow();
          }
      }
  
      private class LoginButtonHandler implements ActionListener {
          public void actionPerformed(ActionEvent e) {
              if(_uid.getText().equalsIgnoreCase("Nathan") &amp;&amp; _pwd.getText().equals("password")) {
                  JOptionPane.showMessageDialog(null, "Congratulations on logging in!");
              } else {
                JOptionPane.showMessageDialog(null, "Error on login!");
              }
          }
      }
  
      public static void main(String[] args) {
          new Main();
      }
  }
  </code></pre>