@Override
    public String getUsername() throws RemoteException {
        {
            try {
                String name = JOptionPane.showInputDialog(null, "Please, enter your nickname!");
                if (name != null && name.trim().length() > 0) {
                    nickname = name;
                    return name;
                } else if (name == null) {
                    System.exit(0);
                } else {
                    JOptionPane.showMessageDialog(null, "Please choose a nickname with more than one letter!");
                    getUsername();
                }
            } catch (RemoteException ex) {
                ex.printStackTrace();
                System.exit(0);
            }

            return null;
        }
    }