private static boolean createImageFile(BufferedImage image) {
		String name = JOptionPane.showInputDialog("please enter file name.");
		File f = new File(filesys.getHomeDirectory() + "/Desktop/" + name);
if (name == null)
	return false;
		if (!f.exists() && name != null)
			try {
				ImageIO.write(image, "jpg", f);
				return true;
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		else {
			while (f.exists() && name != null) {
				name = JOptionPane
						.showInputDialog("file of the same name exists in the same directory.\nplease enter file name.");
				f = new File(filesys.getHomeDirectory() + "/Desktop/" + name);
			}
			if (!f.exists() && name != null)
				try {
					ImageIO.write(image, "jpg", f);
					return true;
				} catch (IOException e) {
					e.printStackTrace();
				}
		}
		return false;

	}