code: private void onOK() {
  		host = host_text.getText().trim();
  		user = user_text.getText();
  		password = password_text.getText();
  
  		if (host.length() == 0) {
  			warn("Proxy host is not set!");
  			return;
  		}
  		if (socks_group.getSelectedCheckbox() == socks4radio) {
  			if (user.length() == 0) {
  				warn("User name is not set");
  				return;
  			}
  
  		} else {
  			if (up_check.getState()) {
  				if (user.length() == 0) {
  					warn("User name is not set.");
  					return;
  				}
  				if (password.length() == 0) {
  					warn("Password is not set.");
  					return;
  				}
  			} else if (!none_check.getState()) {
  				warn("Please select at least one Authentication Method.");
  				return;
  			}
  		}
  
  		try {
  			port = Integer.parseInt(port_text.getText());
  		} catch (NumberFormatException nfe) {
  			warn("Proxy port is invalid!");
  			return;
  		}
  
  		mode = OK_MODE;
  
  		if (useThreads) {
  			net_thread = new Thread(this);
  			net_thread.start();
  
  			info("Looking up host: " + host);
  			// System.out.println("Info returned.");
  		} else if (!initProxy()) {
  			warn("Proxy host is invalid.");
  			mode = COMMAND_MODE;
  		}
  
  		if (mode == OK_MODE)
  			dispose();
  	}
docs: /////////////////