@Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource() instanceof JComboBox) {
            if (((JComboBox) e.getSource()).getSelectedIndex() == 0) {
                ipadr.setVisible(false);
                ipAdress.setVisible(false);
                myAdress.setVisible(true);
                vc1.setVisible(true);
                vc2.setVisible(false);
            } else {
                ipadr.setVisible(true);
                ipAdress.setVisible(true);
                myAdress.setVisible(false);
                vc1.setVisible(false);
                vc2.setVisible(true);
            }
        }

        if (e.getSource() instanceof JButton) {
            switch (LanConn.getSelectedIndex()) {
                case 0: {
                    if (name.getText().trim().length() > 0) {
                        createGame(name.getText().trim());
                    }
                    break;
                }
                case 1: {
                    if (name.getText().trim().length() > 0 && ipAdress.getText().length() > 0) {
                        if (joinGame(name.getText().trim(), ipAdress.getText())) {
                            this.dispose();
                        }
                    }
                    break;
                }
            }
        }
    }