private void initToolbar(JToolBar toolBar) {

		//NEW BUTTON - creates a new simulation with a new turing machines
		JButton btnNew = createIconButton("/icons/ic_new.png", TOOLBAR_BUTTONSIZE);
		btnNew.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				TuringMachineCreationDialog creationDialog = new TuringMachineCreationDialog();
				creationDialog.setVisible(true);
				if (!creationDialog.canceled) {
					addSimulation(creationDialog.name, creationDialog.type, creationDialog.alphabet);
				}
			}
		});
		toolBar.add(btnNew);

		//LOAD BUTTON - loads the current simulation
		JButton btnLoad = createIconButton("/icons/ic_open.png", TOOLBAR_BUTTONSIZE);
		btnLoad.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				loadRoutine();
			}
		});
		toolBar.add(btnLoad);

		//SAVE BUTTON - saves the current simulation
		JButton btnSave = createIconButton("/icons/ic_save.png", TOOLBAR_BUTTONSIZE);
		btnSave.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				saveRoutine();
			}
		});
		toolBar.add(btnSave);

		//ZOOM IN BUTTON - zooms into the tape
		JButton btnZoomIn = createIconButton("/icons/ic_zoom_in.png", TOOLBAR_BUTTONSIZE);
		btnZoomIn.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				ContentPanel content = (ContentPanel) tpSimTabs.getSelectedComponent();
				content.getTuringPanel().zoomIn();
				update(null, "zoomIn");
			}
		});
		toolBar.add(btnZoomIn);

		//ZOOM OUT BUTTON - zooms out of the tape
		JButton btnZoomOut = createIconButton("/icons/ic_zoom_out.png", TOOLBAR_BUTTONSIZE);
		btnZoomOut.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				ContentPanel content = (ContentPanel) tpSimTabs.getSelectedComponent();
				content.getTuringPanel().zoomOut();
				update(null, "zoomOut");
			}
		});
		toolBar.add(btnZoomOut);


		//ADD STATE BUTTON - creates and adds a new state
		JButton btnAddState = createIconButton("/icons/ic_addState.png", TOOLBAR_BUTTONSIZE);
		btnAddState.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				//Create Dialog. Add State, if dialog has not been cancelled
				StateCreationDialog dialog = new StateCreationDialog();
				dialog.setVisible(true);
				if (!dialog.canceled) {
					TuringEditor editor = main.getSimulationController().getSimulation(foregroundID).getEditor();
					try {
						editor.addState(dialog.name);
					} catch (DuplicateStateException e) {
						JOptionPane.showMessageDialog(main, "There already exists a state with this name");
					}
				}
			}
		});
		toolBar.add(btnAddState);

		//REMOVE STATE BUTTON - removes the selected state
		JButton btnRemoveState = createIconButton("/icons/ic_removeState.png", TOOLBAR_BUTTONSIZE);
		btnRemoveState.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContentPanel content = (ContentPanel) tpSimTabs.getSelectedComponent();
				State selected = content.getStatePanel().getSelectedState();
				if (selected != null) {
					try {
						main.getSimulationController().getSimulation(foregroundID).getEditor().removeState(selected.getID());
						content.getStatePanel().hideButton();
					} catch (UnresolvedReferenceException e) {
						JOptionPane.showMessageDialog(main, "Cannot delete: this state is referenced in another state's transition table");
					}
				}
			}
		});
		toolBar.add(btnRemoveState);


		//ABOUT BUTTON - opens a dialog for various simulation-related information
		JButton btnAbout = createIconButton("/icons/ic_settings.png", TOOLBAR_BUTTONSIZE);
		btnAbout.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				AboutDialog dialog = new AboutDialog();
				dialog.setVisible(true);
			}
		});
		toolBar.add(btnAbout);
	}