client.initializeListeners();
    public void connectBot() {        ConnectDialog cd;        cd = new ConnectDialog(frame);        cd.show();        // 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, "Connect to Game",                             "Error: enter a player name." ).show();            return;        }        // initialize game        client = new TestBot(cd.name);        client.initializeListeners();        // verify connection        if(!client.connect(cd.serverAddr, cd.port)) {            server = null;            client = null;            new AlertDialog(frame, "Connect to Game", "Error: could not connect.").show();            return;        }        // wait for full connection        client.retrieveServerInfo();                launch(client.getFrame());    }