public static String save(Component parent, String filestring) {
		if (FileDialogs.hasFileAccess()) {
			URL url = ClassLoader.getSystemResource("circuits");
			String urlName = url.getFile().substring(1);

			if (FileDialogs.fc == null) {
				FileDialogs.fc = new JFileChooser(urlName);
			}
			FileDialogs.fc.setFileFilter(new TextFilter("cir"));

			int returnVal = FileDialogs.fc.showSaveDialog(parent);

			if (returnVal == 0) {
				try {
					File file = FileDialogs.fc.getSelectedFile();
					FileOutputStream fw = new FileOutputStream(file);
					OutputStreamWriter ow = new OutputStreamWriter(fw, "ISO-8859-1");
					BufferedWriter bw = new BufferedWriter(ow);

					StringReader sr = new StringReader(filestring);
					BufferedReader br = new BufferedReader(sr);
					String line;
					while ((line = br.readLine()) != null) {
						bw.write(line);
						bw.newLine();
					}

					bw.close();
					fw.close();
					ow.close();

					sr.close();
					br.close();

					return file.getCanonicalPath();
				} catch (IOException e) {
					JOptionPane.showMessageDialog(parent, "Error Saving File.\n" + e.getMessage(), "Error FileDialogs.001", 0);
				}

			}

		} else if (FileDialogs.hasClipboardAccess()) {
			final JDialog dialog = new JDialog(JOptionPane.getFrameForComponent(parent), "Save", true);

			dialog.getContentPane().setLayout(new BorderLayout());

			JPanel pane = new JPanel(new BorderLayout());
			JLabel label = new JLabel("To Save copy text into a file");

			label.setForeground(Color.black);

			final JTextArea savearea = new JTextArea(filestring);
			savearea.setEditable(false);
			savearea.selectAll();
			savearea.setPreferredSize(new Dimension(200, 300));

			JScrollPane scroller = new JScrollPane(savearea);
			pane.add(scroller, "Center");

			dialog.getContentPane().add(label, "North");
			dialog.getContentPane().add(pane, "Center");

			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(1));
			dialog.getContentPane().add(buttonPane, "South");

			JButton copyButton = new JButton("Copy");
			buttonPane.add(copyButton);
			copyButton.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					savearea.selectAll();
					savearea.copy();
				}
			});
			JButton okButton = new JButton("Close");
			dialog.getRootPane().setDefaultButton(okButton);
			buttonPane.add(okButton);
			okButton.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					dialog.setVisible(false);
				}
			});
			dialog.setLocationRelativeTo(parent);
			dialog.pack();

			dialog.setVisible(false);
		} else {
			JOptionPane.showMessageDialog(parent, "Insufficient privilages to save.\nSee Help-Loading and Saving or the Webpage for details of how to enable loading and saving.", "Loading and Saving Disabled", 2);
		}

		return "";
	}