get System Preferences - Java java.util.prefs

Java examples for java.util.prefs:Preferences

Description

get System Preferences

Demo Code


//package com.java2s;
import java.util.HashMap;
import java.util.prefs.Preferences;

public class Main {
    private static HashMap<String, Preferences> systemPreferences = new HashMap<String, Preferences>();

    public static Preferences getSystemPreferences(String name) {
        Preferences pref = null;/*from   www  . j  a va  2  s. c  o m*/

        if (systemPreferences.containsKey(name)) {
            return systemPreferences.get(name);
        }

        pref = Preferences.systemRoot().node(name);
        systemPreferences.put(name, pref);

        return pref;
    }
}

Related Tutorials