public void rememberFile(String fileName, final JMenu recentFilesMenu) {
		if (historyMap == null)
			return;
		if (fileName == null)
			return;
		int max = RECENT_FILES.length;
		if (recentFiles.contains(fileName)) {
			recentFiles.remove(fileName);
		}
		else {
			if (recentFiles.size() >= max)
				recentFiles.remove(0);
		}
		recentFiles.add(fileName);
		final int n = recentFiles.size();
		for (int i = 0; i < max; i++) {
			if (i < n)
				historyMap.put(RECENT_FILES[max - 1 - i], recentFiles.get(i));
		}
		if (recentFilesMenu != null)
			EventQueue.invokeLater(new Runnable() {
				public void run() {
					JMenuItem mi;
					for (int i = 0; i < n; i++) {
						mi = recentFilesMenu.getItem(i);
						mi.setText(recentFiles.get(n - 1 - i));
					}
				}
			});
	}