@SuppressWarnings({ "unused", "resource" })
	public String[] dataCleanse() {

		// Validate and filter the host data.
		String host = serverField.getText();

		if (host.equals("")) {
			errorLabel.setText("PLEASE SPECIFY HOST");
		} else {
			try {
				InetAddress ia = InetAddress.getByName(host);
				host = ia.getHostAddress();
				int thePort = Integer.parseInt(portField.getText());
				Socket s = new Socket(ia, thePort);
				s = null;
			} catch (UnknownHostException e2) {
				errorLabel.setText("INVALID HOST");
			} catch (IOException e) {
				errorLabel.setText("SERVER NOT FOUND");
			}
		}

		// Validate and filter the port data.
		String port = portField.getText();

		if (port.equals("")) {
			errorLabel.setText("PLEASE SPECIFY PORT");
		} else {
			try {
				int portNum = Integer.parseInt(port);
				port = String.valueOf(portNum);
			} catch (NumberFormatException e) {
				errorLabel.setText("INVALID PORT");
			}
		}

		// Validate and filter the player name data.
		String playerName = nameField.getText();

		if (playerName.equals("")) {
			errorLabel.setText("PLEASE SPECIFY A NAME");
		} else {
			boolean validName = Pattern.compile("^[A-Za-z0-9]+$")
					.matcher(playerName).matches();
			if (!validName)
				errorLabel.setText("INVALID NAME");
		}

		String validData[] = { host, port, playerName };
		return validData;
	}