@Override
	public void actionPerformed(ActionEvent actionEvent) {
		Object source = actionEvent.getSource();
		JFileChooser fileChooser = new JFileChooser();
		fileChooser.setFileFilter(new FileFilter() {

			public String getDescription() {
				return "Wireworld file (*.w)";
			}

			public boolean accept(File f) {
				if (f.isDirectory()) {
					return true;
				} else {
					return f.getName().toLowerCase().endsWith(".w");
				}
			}
		});

		if(source == imp) {
			int status = fileChooser.showOpenDialog(this);
			if(status == JFileChooser.APPROVE_OPTION) {
				File file = fileChooser.getSelectedFile();
				GridImporter importer = GridImporter.getInstance();
				Wireworld wireworld = Wireworld.getInstance();
				try {
					wireworld.setGrid(importer.gridImport(file));
				} catch (IOException e) {
					JOptionPane.showMessageDialog(this, e, "Error", JOptionPane.ERROR_MESSAGE);
				} catch (ClassNotFoundException e) {
					JOptionPane.showMessageDialog(this, e, "Error", JOptionPane.ERROR_MESSAGE);
				}
			}
		} else if (source == exp) {
			int status = fileChooser.showSaveDialog(this);
			if(status == JFileChooser.APPROVE_OPTION) {
				File file = fileChooser.getSelectedFile();
				GridExporter exporter = GridExporter.getInstance();
				try {
					exporter.gridExport(Wireworld.getInstance(), file);
				} catch (IOException e) {
					JOptionPane.showMessageDialog(this, e, "Error", JOptionPane.ERROR_MESSAGE);
				}
			}
		}
	}