public static void save() {

		Collections.sort(bookmarklist);

		File bookmarkFile = new File("bookmarks.txt");

		// rensa textfil
		try {
			writer = new BufferedWriter(new FileWriter(bookmarkFile));
			writer.write("");
			writer.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		// skriv varje bokmärke till filen på ny rad
		for (Bookmark bookmark : bookmarklist) {
			try {
				writer = new BufferedWriter(new FileWriter(
						bookmarkFile.getAbsoluteFile(), true));
				writer.write("Name:" + bookmark.name + "URL:" + bookmark.url
						+ "\n");
				writer.close();

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}