public ConfigWindow()
	{
		this.setTitle("SliceAndDaid - " + CraftConfig.VERSION);
		this.setResizable(false);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		JTabbedPane tabbedPane = new JTabbedPane();
		this.configSettingsPanel = new JPanel();
		this.configSettingsPanel.setLayout(new BoxLayout(this.configSettingsPanel, BoxLayout.Y_AXIS));
		this.actionPanel = new JPanel(new GridBagLayout());

		final JTextArea startCodeTextArea = new JTextArea(CraftConfig.startGCode);
		final JTextArea endCodeTextArea = new JTextArea(CraftConfig.endGCode);
		startCodeTextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));
		endCodeTextArea.setFont(new Font("Monospaced", Font.PLAIN, 12));

		startCodeTextArea.addFocusListener(new FocusAdapter()
		{
			public void focusLost(FocusEvent e)
			{
				CraftConfig.startGCode = startCodeTextArea.getText();
				CraftConfigLoader.saveConfig(null);
			}
		});
		endCodeTextArea.addFocusListener(new FocusAdapter()
		{
			public void focusLost(FocusEvent e)
			{
				CraftConfig.endGCode = endCodeTextArea.getText();
				CraftConfigLoader.saveConfig(null);
			}
		});

		tabbedPane.addTab("Settings", this.configSettingsPanel);
		tabbedPane.addTab("Start GCode", new JScrollPane(startCodeTextArea));
		tabbedPane.addTab("End GCode", new JScrollPane(endCodeTextArea));

		GridBagConstraints c = new GridBagConstraints();
		c.gridy = 0;
		c.anchor = GridBagConstraints.WEST;
		c.insets = new Insets(1, 1, 1, 1);
		c.fill = GridBagConstraints.HORIZONTAL;

		JButton sliceButton = new JButton("Slice");
		sliceButton.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				final JFileChooser fc = new JFileChooser();
				fc.setFileFilter(new FileFilter()
				{
					public boolean accept(File f)
					{
						if (f.isDirectory())
							return true;
						return f.getName().endsWith(".stl");
					}

					public String getDescription()
					{
						return null;
					}

				});
				fc.setSelectedFile(new File(CraftConfig.lastSlicedFile));
				int returnVal = fc.showOpenDialog(null);
				if (returnVal == JFileChooser.APPROVE_OPTION)
				{
					final LogWindow logWindow = new LogWindow();
					new Thread(new Runnable()
					{
						public void run()
						{
							try
							{
								SliceAndDaidMain.sliceModel(fc.getSelectedFile().toString());
								logWindow.dispose();
							} catch (Exception e)
							{
								e.printStackTrace();
								logWindow.dispose();
								StringBuilder sb = new StringBuilder();
								sb.append(e.toString());
								sb.append("\n");
								for (StackTraceElement el : e.getStackTrace())
								{
									sb.append(el.toString());
									sb.append("\n");
								}
								JOptionPane.showMessageDialog(null, sb, "Exception", JOptionPane.ERROR_MESSAGE);
							}
						}
					}).start();
					ConfigWindow.this.dispose();
				}
			}
		});
		this.actionPanel.add(sliceButton, c);

		final JComboBox levelSelect = new JComboBox(new String[] { "Starter", "Normal", "Advance", "+Kitchen sink" });
		levelSelect.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				CraftConfig.showLevel = levelSelect.getSelectedIndex();
				Color buttonBgColor = null;
				for (Component c : levelSelect.getComponents())
				{
					if (c instanceof JButton)
						buttonBgColor = ((JButton) c).getBackground();
				}
				levelSelect.setBackground(levelColor(CraftConfig.showLevel));
				for (Component c : levelSelect.getComponents())
				{
					if (c instanceof JButton)
						((JButton) c).setBackground(buttonBgColor);
				}
				CraftConfigLoader.saveConfig(null);
				createConfigFields();
			}
		});
		levelSelect.setSelectedIndex(CraftConfig.showLevel);
		levelSelect.setRenderer(new DefaultListCellRenderer()
		{
			private static final long serialVersionUID = 1L;

			public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
			{
				super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
				if (isSelected)
					this.setBackground(levelColor(index).darker());
				else
					this.setBackground(levelColor(index));
				return this;
			}
		});
		this.actionPanel.add(levelSelect, c);

		this.add(tabbedPane);
		this.add(actionPanel, BorderLayout.SOUTH);

		createConfigFields();
		this.setVisible(true);
	}