private void initialize() throws IOException {

		// Instantiate frame, set title/size/closeoperation/layout
		frame = new JFrame();
		frame.setTitle("ecp - Drum Machine");
		frame.setBounds(100, 0, 845, 780);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLayout(new BorderLayout());

		// Boxes to layout the controls
		Box rowImageSource = Box.createHorizontalBox();
		Box rowBeatControls = Box.createHorizontalBox();
		Box rowAnalyzer = Box.createHorizontalBox();

		// Instantiate the filter selection and add the filter selection to the
		// frame
		BeatControls beatControls = new BeatControls();
		rowBeatControls.add(beatControls);

		// Get the model instance
		final Model model = Model.getInstance();

		// Instantiate the drum pad and add it to the frame
		DrumPad drumPad = new DrumPad();
		frame.add(drumPad, BorderLayout.WEST);

		// Instantiate the filter selection and add the filter selection to the
		// frame
		final FilterSelection filterSelection = new FilterSelection();
		rowAnalyzer.add(filterSelection, BorderLayout.NORTH);

		// Initiate the button which selects the default image
		final JButton defaultPic = new JButton("Default Image");
		defaultPic.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				try {
					BufferedImage newImage = ImageIO.read(new File(
							"res/farben.jpg"));

					// Set the image in the model
					model.setImage(newImage, false);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});

		// Instantiate the file chooser to select images and add it to the frame
		final JFileChooser fileChooser = new JFileChooser();
		JButton openFileChooser = new JButton("Select Image");
		openFileChooser.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {

				fileChooser.showOpenDialog(frame);
				if (fileChooser.getSelectedFile() != null) {
					String filename = fileChooser.getSelectedFile()
							.getAbsolutePath();

					if (filename != null) {

						try {
							// Read the selected image
							BufferedImage newImage = ImageIO.read(new File(
									filename));

							// Set the image in the model
							model.setImage(newImage, false);
						} catch (IOException e1) {
							e1.printStackTrace();
						}

					}
				}

			}
		});

		final JButton captureWebcam = new JButton("Start Webcam Capture");
		captureWebcam.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {

				model.toggleWebcamCapture();
				if (captureWebcam.getText() == "Start Webcam Capture") {
					captureWebcam.setText("Stop Webcam Capture");
				} else {
					captureWebcam.setText("Start Webcam Capture");

				}
			}
		});

		final JButton captureWebcamFrame = new JButton("Take Webcam Snapshot");
		captureWebcamFrame.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				model.takeWebcamSnapshot();
			}
		});

		rowImageSource.add(defaultPic);
		rowImageSource.add(openFileChooser);
		rowImageSource.add(captureWebcam);
		rowImageSource.add(captureWebcamFrame);

		Box topControls = Box.createVerticalBox();
		topControls.add(rowImageSource);
		topControls.add(rowBeatControls);
		topControls.add(rowAnalyzer);

		frame.add(topControls, BorderLayout.NORTH);

	}