Code example for PasswordAuthentication

0
         
        if (option == JOptionPane.OK_OPTION) {
            String user = username.getText();
            char   pass[] = password.getText().toCharArray();
             
            return new PasswordAuthentication(user, pass);
        } 
        return null; 
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE