public static void write() {	//writes the file back out if it's been modified
		if(file == null) {
			JOptionPane.showMessageDialog(null,
					"Read-only file was imported. Can not write.",
					"Read-Only file", JOptionPane.INFORMATION_MESSAGE);
			return;
		}
		try {
			fWriter = new PrintWriter(file, "UTF-8");
			writeOut(head);	//recursive write method
			fWriter.close();
		}
		catch(FileNotFoundException e) {
			JOptionPane.showMessageDialog(null,
					"File not found.\nCan not write.", "Error",
					JOptionPane.ERROR_MESSAGE);
		}
		catch(UnsupportedEncodingException e) {
			JOptionPane
					.showMessageDialog(
							null,
							"Unsupported Encoding charset \"UTF-8\"\nCan not write.",
							"Error", JOptionPane.ERROR_MESSAGE);
		}
	}