public StartServerDialog(final PacketFactoryInterface pf) {
        setResizable(false);
        setModalityType(ModalityType.APPLICATION_MODAL);
        setTitle("Start Game");
        setBounds(BORDER1, BORDER1, BORDER2, BORDER3);
        getContentPane().setLayout(new BorderLayout());
        contentPanel.setBorder(new EmptyBorder(PANELSIZE, PANELSIZE, PANELSIZE, PANELSIZE));
        getContentPane().add(contentPanel, BorderLayout.CENTER);

        lblStatus = new JLabel(" ");

        password = new JTextField();

        JLabel lblNewLabel = new JLabel("Password:");
        lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);

        JLabel lblName = new JLabel("Name:");
        lblName.setHorizontalAlignment(SwingConstants.RIGHT);

        name = new JTextField();

        JLabel lblNewLabel1 = new JLabel("Chose the name you want on your server and specify a password for it.");
        lblNewLabel1.setVerticalAlignment(SwingConstants.TOP);
        GroupLayout glContentPanel = new GroupLayout(contentPanel);
        glContentPanel.setHorizontalGroup(glContentPanel.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, glContentPanel.createSequentialGroup().addContainerGap().addGroup(glContentPanel.createParallelGroup(Alignment.TRAILING).addComponent(lblNewLabel1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, SPACE, Short.MAX_VALUE).addComponent(lblStatus, GroupLayout.DEFAULT_SIZE, SPACE, Short.MAX_VALUE).addGroup(Alignment.LEADING, glContentPanel.createSequentialGroup().addGroup(glContentPanel.createParallelGroup(Alignment.LEADING).addComponent(lblNewLabel, GroupLayout.PREFERRED_SIZE, SPACE2, GroupLayout.PREFERRED_SIZE).addComponent(lblName, GroupLayout.PREFERRED_SIZE, SPACE2, GroupLayout.PREFERRED_SIZE)).addPreferredGap(ComponentPlacement.RELATED).addGroup(glContentPanel.createParallelGroup(Alignment.LEADING).addComponent(name, GroupLayout.DEFAULT_SIZE, SPACE4, Short.MAX_VALUE).addComponent(password, 0, SPACE5, Short.MAX_VALUE)))).addContainerGap()));
        glContentPanel.setVerticalGroup(glContentPanel.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING, glContentPanel.createSequentialGroup().addContainerGap().addGroup(glContentPanel.createParallelGroup(Alignment.BASELINE).addComponent(name, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(lblName)).addPreferredGap(ComponentPlacement.RELATED).addGroup(glContentPanel.createParallelGroup(Alignment.BASELINE).addComponent(password, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(lblNewLabel)).addPreferredGap(ComponentPlacement.RELATED).addComponent(lblStatus).addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblNewLabel1).addContainerGap(SPACE3, Short.MAX_VALUE)));
        contentPanel.setLayout(glContentPanel);
        {
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
            getContentPane().add(buttonPane, BorderLayout.SOUTH);
            {
                okButton = new JButton("Start!");
                okButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        reset();
                        new ServerThread(password.getText());

                        GameNetworkInterface gnet = null;
                        try {
                            gnet = Guice.createInjector(new GuiceConfig()).getInstance(GameNetworkInterface.class);
                            gnet.connectTo("localhost");
                            gnet.send(new JoinGamePacket(name.getText(), String.valueOf(password.getText())));
                            IPacket p = gnet.receive(TIMEOUT);
                            if (p instanceof PlayerJoined && ((PlayerJoinedInterface) p).getName().equals(name.getText())) {
                                pf.setGameNetwork(gnet, name.getText());
                                dispose();
                            } else if (p instanceof ErrorPacket) {
                                lblStatus.setForeground(Color.RED);
                                lblStatus.setText(((ErrorInterface) p).getText());
                                gnet.stop();
                            } else {
                                lblStatus.setForeground(Color.RED);
                                lblStatus.setText("Server did not respond in time!");
                                gnet.stop();
                            }
                        } catch (ConnectionFailure e1) {
                            lblStatus.setForeground(Color.RED);
                            lblStatus.setText("Server did not respond!");
                        } catch (IOException e1) {
                            if (gnet != null) {
                                gnet.stop();
                            }
                        } catch (ClassNotFoundException e1) {
                            lblStatus.setForeground(Color.RED);
                            lblStatus.setText("Incorrect Client version! Please update!");
                        }

                    }
                });
                buttonPane.add(okButton);
                getRootPane().setDefaultButton(okButton);
            }
            {
                JButton cancelButton = new JButton("Cancel");
                cancelButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        dispose();
                    }
                });
                cancelButton.setActionCommand("Cancel");
                buttonPane.add(cancelButton);
            }
        }
        this.pack();
        this.setVisible(true);
    }