public ConnectDialog(ElphelVision parent) {

	Parent = parent;

	try {
	    java.awt.EventQueue.invokeAndWait(new Runnable() {

		public void run() {
		    bg = new javax.swing.JPanel();
		    TitleBackground = new javax.swing.JPanel();
		    Title = new javax.swing.JLabel();
		    Image = new javax.swing.JLabel();

		    setBackground(new java.awt.Color(0, 0, 0));
		    setForeground(new java.awt.Color(255, 255, 255));
		    setPreferredSize(new java.awt.Dimension(1024, 600));

		    bg.setBackground(new java.awt.Color(0, 0, 0));
		    bg.setForeground(new java.awt.Color(0, 0, 0));
		    bg.setPreferredSize(new java.awt.Dimension(1024, 600));
		    bg.setLayout(new MigLayout("", "[1024px,grow]", "[233.00px][155px][55.00,grow 30,shrink 30][]"));

		    JPanel ConnectPanel = new JPanel();
		    ConnectPanel.setBackground(Color.BLACK);
		    bg.add(ConnectPanel, "cell 0 1,alignx center,growy");
		    ConnectPanel.setLayout(new MigLayout("", "[][][50px][][][]", "[][][][]"));
		    Camera1IPLabel = new javax.swing.JLabel();
		    ConnectPanel.add(Camera1IPLabel, "cell 0 0,grow");

		    Camera1IPLabel.setFont(new java.awt.Font("Tahoma", 0, 14));
		    Camera1IPLabel.setForeground(new java.awt.Color(255, 255, 255));
		    Camera1IPLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		    Camera1IPLabel.setText("Camera IP: ");
		    CameraIP = new javax.swing.JTextField();
		    CameraIP.setPreferredSize(new Dimension(150, 20));
		    ConnectPanel.add(CameraIP, "cell 1 0,grow");

		    CameraIP.setText("192.168.0.9");
		    CameraIP.setMargin(new java.awt.Insets(0, 4, 0, 0));
		    IP_type = new EButton(Parent);
		    IP_type.addActionListener(new ActionListener() {
		    	public void actionPerformed(ActionEvent e) {
		    	    
		    	}
		    });
		    ConnectPanel.add(IP_type, "cell 2 0,grow");

		    IP_type.setFont(new java.awt.Font("DejaVu Sans", 0, 10));
		    IP_type.setText("type");
		    IP_type.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    IP_typeMouseClicked(evt);
			}
		    });
		    ConnectButton = new EButton(Parent);
		    ConnectButton.setSize(new Dimension(80, 35));
		    ConnectPanel.add(ConnectButton, "cell 3 0 1 2,grow");

		    ConnectButton.setText("Connect");
		    ConnectButton.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    ConnectButtonMouseClicked(evt);
			}
		    });
		    ConnectButton.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
			    ConnectButtonActionPerformed(evt);
			}
		    });
		    Stereo3DButton = new EButton(Parent);
		    ConnectPanel.add(Stereo3DButton, "cell 0 1,grow");

		    Stereo3DButton.setBackground(new java.awt.Color(254, 254, 254));
		    Stereo3DButton.setText("Stereo 3D");
		    CameraIP2 = new javax.swing.JTextField();
		    ConnectPanel.add(CameraIP2, "cell 1 1,grow");

		    CameraIP2.setText("192.168.0.9");
		    CameraIP2.setEnabled(false);
		    CameraIP2.setMargin(new java.awt.Insets(0, 4, 0, 0));
		    IP2_type = new EButton(Parent);
		    ConnectPanel.add(IP2_type, "cell 2 1,grow");

		    IP2_type.setEnabled(false);
		    IP2_type.setFont(new java.awt.Font("DejaVu Sans", 0, 10));
		    IP2_type.setText("type");
		    VLCButton = new EButton(Parent);
		    VLCButton.setMaximumSize(new Dimension(80, 35));
		    ConnectPanel.add(VLCButton, "cell 0 3,alignx left,growy");
		    VLCButton.setText("VLC");
		    GstreamerButton = new EButton(Parent);
		    GstreamerButton.setToolTipText("Gstreamer is still experimental  - DONT USE IT");
		    ConnectPanel.add(GstreamerButton, "cell 1 3,alignx left,growy");

		    GstreamerButton.setText("Gstreamer");
		    jLabel1 = new javax.swing.JLabel();
		    ConnectPanel.add(jLabel1, "cell 2 3 2 1,grow");

		    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
		    jLabel1.setText("Gstreamer is experimental");
		    GstreamerButton.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    GstreamerButtonMouseClicked(evt);
			}
		    });
		    VLCButton.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    VLCButtonMouseClicked(evt);
			}
		    });
		    IP2_type.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    IP2_typeMouseClicked(evt);
			}
		    });
		    Stereo3DButton.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    Stereo3DButtonMouseClicked(evt);
			}
		    });
		    setLayout(new BorderLayout(0, 0));

		    TitleBackground.setBackground(new java.awt.Color(0, 0, 0));

		    Title.setFont(new java.awt.Font("Tahoma", 0, 14));
		    Title.setForeground(new java.awt.Color(255, 255, 255));
		    Title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		    Title.setText("Elphel Vision Alpha  V");

		    Image.setBackground(new java.awt.Color(0, 0, 0));
		    Image.setFont(new java.awt.Font("Tahoma", 0, 14));
		    Image.setForeground(new java.awt.Color(255, 255, 255));
		    Image.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
		    Image.setIcon(new javax.swing.ImageIcon(getClass().getResource("/media/apertus.png")));

		    bg.add(TitleBackground, "cell 0 0,grow");
		    bg.setBackground(Parent.Settings.GetPanelBackgroundColor());
		    TitleBackground.setBackground(Parent.Settings.GetPanelBackgroundColor());
		    Title.setForeground(Parent.Settings.GetTextColor());

		    Title.setText("Elphel Vision Alpha " + Parent.getAppVersion());
		    TitleBackground.setLayout(new MigLayout("", "[979.00px,grow]", "[213px][25px]"));
		    TitleBackground.add(Image, "cell 0 0,alignx center,aligny center");
		    TitleBackground.add(Title, "cell 0 1,grow");
		    Camera1IPLabel.setForeground(Parent.Settings.GetTextColor());
		    VLCButton.setChecked(true);
		    ExitButton = new EButton(Parent);
		    bg.add(ExitButton, "cell 0 3,alignx right");

		    ExitButton.setForeground(new java.awt.Color(217, 2, 2));
		    ExitButton.setText("Exit");
		    add(bg);
		    ExitButton.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent evt) {
			    ExitButtonMouseClicked(evt);
			}
		    });
		    if (Parent.Settings.GetVideoPlayer() == streamVideoPlayer.VLC) {
		    }
		    if (Parent.Settings.GetVideoPlayer() == streamVideoPlayer.GSTREAMER) {

		    }

		    // Title.setText("Elphel Vision Alpha V" +
		    // Parent.GetAppVersion());
		    // AnimationPanel.addGLEventListener(new
		    // JoglIntroAnimation());
		    // IntroAnimator = new Animator(AnimationPanel);
		    // IntroAnimator.start(); // JOGL is still troublesome so
		    // disabled for now

		}
	    });

	} catch (Exception ex) {
	    ex.printStackTrace();
	}

	new Thread() {

	    public void run() {
		Parent.WriteLogtoConsole("Looking for autosave.config to read IP");
		File AutoSaveFile = new File("autosave.config");

		if (AutoSaveFile.exists()) {
		    try {
			ArrayList IPs = Parent.Camera.ReadConfigFileIP("autosave.config");
			CameraIP.setText((String) IPs.get(0));
			Parent.WriteLogtoConsole("autosave.config found - IP loaded");
			if (IPs.size() > 1) {
			    Stereo3DButton.setChecked(true);
			    CameraIP2.setEnabled(true);
			    CameraIP2.setText((String) IPs.get(1));
			    Parent.WriteLogtoConsole("second IP found in autosave.config - enabling Stereo3D");
			}
		    } catch (FileNotFoundException ex) {
			Logger.getLogger(ConnectDialog.class.getName()).log(Level.SEVERE, null, ex);
		    }
		} else {
		    Parent.WriteWarningtoConsole("autosave.config not found: falling back to default.config");
		    try {
			String IP = (String) Parent.Camera.ReadConfigFileIP("default.config").get(0);
			if (IP != null) {
			    CameraIP.setText(IP);
			    Parent.WriteLogtoConsole("default.config found: read IP: " + IP);
			} else {
			    Parent.WriteWarningtoConsole("default.config not found: using 192.168.0.9 as default IP");
			}
		    } catch (FileNotFoundException ex) {
			Parent.WriteWarningtoConsole("default.config not found: using 192.168.0.9 as default IP");
			Logger.getLogger(ConnectDialog.class.getName()).log(Level.SEVERE, null, ex);
		    }
		}
	    }
	}.start();

	// Tests to deal with keyboard shortcuts
	ActionListener actionListener = new ActionListener() {

	    public void actionPerformed(ActionEvent actionEvent) {
		Parent.WriteLogtoConsole("keypressed: " + actionEvent.paramString());
	    }
	};
	KeyStroke up = KeyStroke.getKeyStroke('c');
	this.registerKeyboardAction(actionListener, "c childfocus", up, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
	this.registerKeyboardAction(actionListener, "c focus", up, JComponent.WHEN_IN_FOCUSED_WINDOW);
	this.requestFocus();
    }