@Override
			public void actionPerformed(ActionEvent arg0) {

				SwingUtilities.invokeLater(new Runnable() {
					public void run() {
						int returnVal = fileChooser.showOpenDialog(leftPanel);
						if (returnVal == JFileChooser.APPROVE_OPTION) {
							// facem enabled butoanele
							compareButton.setEnabled(true);
							binarizationButton.setEnabled(true);
							preprocessingButton.setEnabled(true);
							updateButton.setEnabled(true);

							// Setam calea catre fisier in textBox
							pathTextField.setText(fileChooser.getSelectedFile()
									.getAbsolutePath());
							// salvam calea catre imagine
							pathImage = pathTextField.getText();
							// Incarcam imaginea in panel

							// construieste imagine din calea "pathImage" cu
							// dimensiunile width si height
							Image image = ImageViewer.buildImage(pathImage);

							// facem imaginea greyscale in spate
							BufferedImage image_new = null;
							File outputBlack = null;
							try {
								image_new = ImageIO.read(new File(pathTextField
										.getText()));
								BufferedImage image2 = new BufferedImage(
										image_new.getWidth(), image_new
												.getHeight(),
										BufferedImage.TYPE_BYTE_GRAY);
								Graphics g = image2.getGraphics();
								g.drawImage(image, 0, 0, null);
								g.dispose();

								// Scriem noua imagine greyscale pe disc
								String delim = "\\.";
								String[] tokens = pathTextField.getText()
										.split(delim);
								inputPath = tokens[0] + "_input.png";
								outputBlack = new File(inputPath);
								outputBlack.createNewFile();
								ImageIO.write(image2, "png", outputBlack);
							} catch (Exception e) {
							}

							// Setam imaginea originala in stanga (pana la o
							// preprocesare)
							ImageIcon myPicture = new ImageIcon(image);
							JLabel picLabel = new JLabel(myPicture);
							picLabel.setSize(new Dimension(myPicture
									.getIconWidth(), myPicture.getIconHeight()));
							imagePanel.removeAll();
							imagePanel.add(picLabel);
							MainWindow.this.repaint();
						}
					}
				});
			}