public void actionPerformed (ActionEvent e){
		String c = e.getActionCommand ();
		if (c.equals ("choose_infile")){
			fchooser.showOpenDialog (this);
			inf = fchooser.getSelectedFile();
			infileL.setText ("Input file: " + inf.getAbsolutePath());
			String infname = inf.getAbsolutePath();
			if (infname.contains(".mol2")){
				outf = new File(infname.substring(0, infname.length()-5) + ".scad");
			} else {
				outf = new File(infname + ".scad");
			}
			outfileL.setText("Output file: " + outf.getAbsolutePath());
		} else if (c.equals("choose_outfile")){
			fchooser.showSaveDialog(this);
			outf = fchooser.getSelectedFile();
			outfileL.setText("Output file: " + outf.getAbsolutePath());
		} else if (c.equals("convert")){
			try {
				int m = mode.getSelectedIndex();
				if (m == 0) {
					Converter.mode = Converter.SPACE_FILLING;
				} else if (m == 1){
					Converter.mode = Converter.BALL_AND_STICK;
				}
				Molecule mol = Converter.readMolecule (inf);
				Converter.writeScadfile (outf, mol);
			} catch (IOException ex){
				JOptionPane.showMessageDialog (this, "IO Exception when converting the files! See console for stack backtrace.", "IO Problem!", JOptionPane.ERROR_MESSAGE);
				ex.printStackTrace();
			} catch (Exception ex){
				JOptionPane.showMessageDialog (this, "General unspecified error occurred! Check console.", "Error!", JOptionPane.ERROR_MESSAGE);
				ex.printStackTrace();
			}
		}
	}