Code example for Preferences

Methods: put

	public void saveQuery(final String query) {
		prefs.put(SAVED_QUERY, query);
	public void saveLoadedFile(final String absolutePath) {
		prefs.put(LOADED_FILE, absolutePath);
	public boolean hasLoadedFile() { 
		String file = prefs.get(LOADED_FILE, null);
		return file != null;
	public String getLoadedFile() {
		return prefs.get(LOADED_FILE, null);
	public boolean hasQuery() { 
		String query = prefs.get(SAVED_QUERY, null);
		return query != null;
Connect your IDE to all the code out there  Get Codota for Java