name = yourNameF.getText();
playerName = yourNameF.getText();
    public void actionPerformed(ActionEvent e) {        if (!e.getActionCommand().equals("cancel")) { //$NON-NLS-1$            try {                name = yourNameF.getText();                serverPass = serverPassF.getText();                register = registerC.isSelected();                metaserver = metaserverF.getText();                port = Integer.parseInt(portF.getText());                goalPlayers = Integer.parseInt(goalF.getText());            } catch (NumberFormatException ex) {                System.err.println(ex.getMessage());                port = 2346;                goalPlayers = 2;            }            // update settings            PreferenceManager.getClientPreferences().setLastPlayerName(name);            PreferenceManager.getClientPreferences().setLastServerPass(serverPass);            PreferenceManager.getClientPreferences().setLastServerPort(port);            PreferenceManager.getClientPreferences().setValue("megamek.megamek.metaservername", //$NON-NLS-1$                    metaserver);            PreferenceManager.getClientPreferences().setValue("megamek.megamek.goalplayers", //$NON-NLS-1$                    Integer.toString(goalPlayers));        }        setVisible(false);    }