String realm = realmTextArea.getText();
String username = usernameTextField.getText();
String password = new String(passwordTextField.getPassword());
if (!(username.equals("") || password.equals(""))) {
if (basicRadioButton.isSelected()) {
BasicCredential bc = new BasicCredential(host, realm, username, password);
_manager.addBasicCredentials(bc);
} else if (domainRadioButton.isSelected()) {
DomainCredential dc = new DomainCredential(host, domain, username, password);
_manager.addDomainCredentials(dc);
}