char[] nameChars = cd.name.toCharArray();
char[] nameChars = cd.playerName.toCharArray();
    public void connect() {        ConnectDialog cd;        cd = new ConnectDialog(frame);        cd.setVisible(true);        // verify dialog data        if (cd.name == null || cd.serverAddr == null || cd.port == 0) {            return;        }        // Players should have to enter a non-blank, non-whitespace name.        boolean foundValid = false;        char[] nameChars = cd.name.toCharArray();        for (int loop = 0; !foundValid && loop < nameChars.length; loop++) {            if (!Character.isWhitespace(nameChars[loop])) {                foundValid = true;            }        }        if (!foundValid) {            new AlertDialog(frame, Messages.getString("MegaMek.ConnectAllert.title"), Messages.getString("MegaMek.ConnectAllert.message")).setVisible(true); //$NON-NLS-1$ //$NON-NLS-2$            return;        }        // initialize game        client = new Client(cd.name, cd.serverAddr, cd.port);        ClientGUI gui = new ClientGUI(client);        gui.initialize();        if (!client.connect()) {            StringBuffer error = new StringBuffer();            error.append("Error: could not connect to server at ").append(cd.serverAddr).append(":").append(cd.port).append(".");            new AlertDialog(frame, Messages.getString("MegaMek.HostGameAllert.title"), error.toString()).setVisible(true); //$NON-NLS-1$            frame.setVisible(false);            client.die();        }        launch(gui.getFrame());    }