port = Integer.decode(portF.getText()).intValue();
port = Integer.decode(portF.getText().trim()).intValue();
    public void actionPerformed(ActionEvent e) {        if (!e.getActionCommand().equals("cancel")) { //$NON-NLS-1$            try {                name = yourNameF.getText();                serverAddr = serverAddrF.getText();                port = Integer.decode(portF.getText()).intValue();            } catch (NumberFormatException ex) {                System.err.println(ex.getMessage());            }            // update settings            PreferenceManager.getClientPreferences().setLastPlayerName(name);            PreferenceManager.getClientPreferences().setLastConnectAddr(serverAddr);            PreferenceManager.getClientPreferences().setLastConnectPort(port);        }        setVisible(false);    }