public JMacroWindow() {
		mode = RunModes.Continuous;
		showConsole.addActionListener(e -> {
			if (showConsole.getText().equals("Show Log")) {
				Console.start();
				showConsole.setText("Hide Log");
			} else {
				Console.stop();
				showConsole.setText("Show Log");
			}
		});
		editData.addActionListener(e -> { if (!"".equals(dataPreview.getText())) editFile(dataPreview.getText()); });
		selectData.addActionListener(e -> selectFile(dataPreview, "CSV Files", "csv", JFileChooser.OPEN_DIALOG).updatePreview(true));
		createData.addActionListener(e -> {
			selectFile(dataPreview, "CSV Files", "csv", JFileChooser.SAVE_DIALOG);
			if (!"".equals(dataPreview.getText())) editFile(dataPreview.getText());
		});
		editScript.addActionListener(e -> { if (!"".equals(scriptPreview.getText())) editFile(scriptPreview.getText()); });
		selectScript.addActionListener(e -> selectFile(scriptPreview, "Macro Files", "mfl", JFileChooser.OPEN_DIALOG).parseScript());
		createScript.addActionListener(e -> {
			selectFile(scriptPreview, "Macro Files", "mfl", JFileChooser.SAVE_DIALOG);
			if (!"".equals(scriptPreview.getText())) editFile(scriptPreview.getText());
		});
		try {
			GlobalScreen.registerNativeHook();
		} catch (NativeHookException e) {
			e.printStackTrace();
			Console.start();
			Console.error("Unable to gain native access to the keyboard. Please restart JMacro");
		}
		next.addActionListener(e -> increment(true));
		previous.addActionListener(e -> increment(false));
		keyListener = new GlobalKeyListener();
		GlobalScreen.getInstance().addNativeKeyListener(keyListener);
		start.addActionListener(e -> startMacro());
		continuousMode.addActionListener(e -> mode = RunModes.Continuous);
		singleInsertMode.addActionListener(e -> mode = RunModes.Discrete);
		progress.addMouseListener(new MouseListener() {
			@Override public void mouseClicked(MouseEvent e) {
				selectDataPosition();
			} @Override public void mousePressed(MouseEvent e) {} @Override public void mouseReleased(MouseEvent e) {}
			@Override public void mouseEntered(MouseEvent e) {} @Override public void mouseExited(MouseEvent e) {}
		});
	}