title: How to enable a button in a mouseClicked java
body: <p>I'm new to java and I'm trying to set rdtnAdministrator.setenabled to false when the password wrong, but when i do it it comes op with this, please explain clearly what im doing wrong.</p>
  
  <pre><code>            public void mouseClicked(MouseEvent e) {
              char[] password = passwordField.getPassword();
              String passString = new String(password);
              if (passString.equalsIgnoreCase("Dave"))
              {
                 System.out.println("Correct!");
                 int loggedin = 1;
              }
              else
              {
                  System.out.println("Wrong!");
                  int loggedin = 0;
                  rdbtnAdministrator.setEnabled(false); // rdbtnAdministrator cannot be resolved
              }
  
  
  
          }
      });
      btnNewButton.setBounds(148, 42, 139, 23);
      frame.getContentPane().setLayout(null);
      frame.getContentPane().add(loginkey);
      frame.getContentPane().add(btnNewButton);
  
  
      JRadioButton rdbtnAdministrator = new JRadioButton("Administrator");
      rdbtnAdministrator.setEnabled(false);
      rdbtnAdministrator.setBounds(386, 10, 109, 23);
      frame.getContentPane().add(rdbtnAdministrator);
  </code></pre>
  
  <p>I know its because its in a mouseClicked but i dont know how to fix it</p>