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);
}
}
setVisible(false);
}