public static void show(JFrame parent) {
        createComponents();
        JPanel conent = createGUI();

        int choice = 0;
        
        while (true) {
            choice = JOptionPane.showOptionDialog(parent, conent, Main.TITLE_MED,
                    JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null,
                    new String[] {"Create", "Cancel"}, 0);
            if (choice != 0) {
                allOK = false;
                break;
            }
            if (!allOK) {
                check();
            } else {
                check();
                if (allOK) {
                    int port = Integer.parseInt(portField.getText());
                    int players = Integer.parseInt(playersField.getText());
                    Settings.setLastCreateInfo(port, players, joinGameBox.isSelected());
                    Settings.save();
                    try {
                        Server.start(port, players);
                        StringSelection ipStr = new StringSelection(
                                ipValue.getText() + ":" + portField.getText());
                        Toolkit.getDefaultToolkit().getSystemClipboard()
                                .setContents(ipStr, null);
                        
                        if (joinGameBox.isSelected()) {
                            Deck deck = Settings.getDeck();
                            if (deck == null) {
                                JOptionPane.showMessageDialog(parent,
                                        "Could not load chosen deck",
                                        Main.TITLE_SHORT, JOptionPane.ERROR_MESSAGE);
                            } else {
                                try {
                                    new game.Client(parent, Settings.getName(), "localhost",
                                            Integer.parseInt(portField.getText()), deck);
                                    parent.setVisible(false);
                                } catch (InvalidDeckException ex) {
                                    Debug.p("Deck rejected by the server: " + ex);
                                    JOptionPane.showMessageDialog(parent,
                                            "Your deck has been rejected by the server: "
                                            + ex.getLocalizedMessage(), Main.TITLE_SHORT,
                                            JOptionPane.WARNING_MESSAGE);
                                    break;
                                } catch (Exception ex) {
                                    Debug.p("Could not join a host: " + ex, Debug.CE);
                                }
                            }
                        }
                        break;
                    } catch (IOException ex1) {
//                        Logger.getLogger(ServerFrame.class.getName()).log(Level.SEVERE, null, ex1);
                        messagesField.setText("Could not create a server:\n" + ex1);
                        allOK = false;
                    }
                }
            }
        }
        allOK = false;
    }