String name = name = "Bot" + lisPlayerInfo.getItemCount();
String name;
    public void actionPerformed(ActionEvent ev) {        // Are we ignoring events?        if (isIgnoringEvents()) {            return;        }        if (ev.getSource().equals(butDone)) {            // enforce exclusive deployment zones in double blind            if (client.game.getOptions().booleanOption("double_blind") &&                    client.game.getOptions().booleanOption("exclusive_db_deployment")) {                int i = client.getLocalPlayer().getStartingPos();                if (i == 0) {                    clientgui.doAlertDialog("Starting Position not allowed", "In Double Blind play, you cannot choose 'Any' as starting position.");                    return;                }                for (Enumeration e = client.game.getPlayers(); e.hasMoreElements();) {                    Player player = (Player) e.nextElement();                    if (player.getStartingPos() == 0) {                        continue;                    }                    // check for overlapping starting directions                    if ((player.getStartingPos() == i ||                            player.getStartingPos() + 1 == i ||                            player.getStartingPos() - 1 == i) &&                            player.getId() != client.getLocalPlayer().getId()) {                        clientgui.doAlertDialog("Must choose exclusive deployment zone", "When using double blind, each player needs to have an exclusive deployment zone.");                        return;                    }                }            }            boolean anyDelayed = false;            Enumeration iter = client.getEntities();            while (iter.hasMoreElements()) {                Entity en = (Entity) iter.nextElement();                if (en.getDeployRound() > 0) {                    anyDelayed = true;                    break;                }            }            boolean done = !client.getLocalPlayer().isDone();            client.sendDone(done);            refreshDoneButton(done);            for (Iterator i = clientgui.getBots().values().iterator(); i.hasNext();) {                ((Client) i.next()).sendDone(done);            }        } else if (ev.getSource().equals(butLoad)) {            loadMech();        } else if (ev.getSource().equals(butLoadCustomBA)) {            loadCustomBA();        } else if (ev.getSource().equals(butCustom) || ev.getSource().equals(lisEntities)) {            customizeMech();        } else if (ev.getSource().equals(butDelete)) {            // delete mech            Entity e = client.getEntity(entityCorrespondance[lisEntities.getSelectedIndex()]);            Client c = (Client) clientgui.getBots().get(e.getOwner().getName());            if (c == null) {                c = client;            }            if (lisEntities.getSelectedIndex() != -1) {                c.sendDeleteEntity(entityCorrespondance[lisEntities.getSelectedIndex()]);            }        } else if (ev.getSource().equals(butDeleteAll)) {            // Build a Vector of this player's entities.            Vector currentUnits = client.game.getPlayerEntities(client.getLocalPlayer());            // Walk through the vector, deleting the entities.            Enumeration entities = currentUnits.elements();            while (entities.hasMoreElements()) {                final Entity entity = (Entity) entities.nextElement();                client.sendDeleteEntity(entity.getId());            }        } else if (ev.getSource().equals(butChangeBoard) || ev.getSource().equals(lisBoardsSelected)) {            // board settings            clientgui.getBoardSelectionDialog().update(client.getMapSettings(), true);            clientgui.getBoardSelectionDialog().setVisible(true);        } else if (ev.getSource().equals(butOptions)) {            // Make sure the game options dialog is editable.            if (!clientgui.getGameOptionsDialog().isEditable()) {                clientgui.getGameOptionsDialog().setEditable(true);            }            // Display the game options dialog.            clientgui.getGameOptionsDialog().update(client.game.getOptions());            clientgui.getGameOptionsDialog().setVisible(true);        } else if (ev.getSource().equals(butChangeStart) || ev.getSource().equals(lisStarts)) {            clientgui.getStartingPositionDialog().update();            Client c = getPlayerListSelected(lisStarts);            if (c == null) {                clientgui.doAlertDialog(Messages.getString("ChatLounge.ImproperCommand"), Messages.getString("ChatLounge.SelectBotOrPlayer")); //$NON-NLS-1$ //$NON-NLS-2$                return;            }            clientgui.getStartingPositionDialog().setClient(c);            clientgui.getStartingPositionDialog().setVisible(true);        } else if (ev.getSource().equals(butMechReadout)) {            mechReadout();        } else if (ev.getSource().equals(butViewGroup)) {            viewGroup();        } else if (ev.getSource().equals(butLoadList)) {            // Allow the player to replace their current            // list of entities with a list from a file.            clientgui.loadListFile();        } else if (ev.getSource().equals(butSaveList)) {            // Allow the player to save their current            // list of entities to a file.            clientgui.saveListFile(client.game.getPlayerEntities(client.getLocalPlayer()));        } else if (ev.getSource().equals(butMinefield)) {            updateMinefield();        } else if (ev.getSource().equals(butCamo)) {            camoDialog.setVisible(true);        } else if (ev.getSource().equals(butAddBot)) {            String name = name = "Bot" + lisPlayerInfo.getItemCount(); //$NON-NLS-1$            name = JOptionPane.showInputDialog(clientgui.frame, Messages.getString("ChatLounge.Name"),                    Messages.getString("ChatLounge.ChooseBotName"), JOptionPane.QUESTION_MESSAGE);            if (name.trim().equals("")) {                name = "Bot" + lisPlayerInfo.getItemCount(); //$NON-NLS-1$            }            BotClient c = new TestBot(name, client.getHost(), client.getPort());            c.game.addGameListener(new BotGUI(c));            try {                c.connect();            } catch (Exception e) {                clientgui.doAlertDialog(Messages.getString("ChatLounge.AlertBot.title"), Messages.getString("ChatLounge.AlertBot.message")); //$NON-NLS-1$ //$NON-NLS-2$            }            c.retrieveServerInfo();            clientgui.getBots().put(name, c);        } else if (ev.getSource().equals(butRemoveBot)) {            Client c = getPlayerListSelected(lisPlayerInfo);            if (c == null || c.equals(client)) {                clientgui.doAlertDialog(Messages.getString("ChatLounge.ImproperCommand"), Messages.getString("ChatLounge.SelectBo")); //$NON-NLS-1$ //$NON-NLS-2$                return;            }            c.die();            clientgui.getBots().remove(c.getName());        }    }