The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.util.prefs  [18 examples]

e408. Removing a Preference from a Preference Node

    // Get the user preference node for java.lang
    Preferences prefs = Preferences.userNodeForPackage(String.class);
    
    // Remove a preference in the node
    final String PREF_NAME = "name_of_preference";
    prefs.remove(PREF_NAME);
    
    // Remove all preferences in the node
    try {
        prefs.clear();
    } catch (BackingStoreException e) {
    }

 Related Examples
e405. Saving and Retrieving a Preference Value
e406. Determining If a Preference Node Contains a Specific Key
e407. Determining If a Preference Node Contains a Specific Value
e409. Getting and Setting Java Type Values in a Preference
e410. Getting the Maximum Size of a Preference Key and Value

See also: Events    Importing and Exporting    Nodes   


© 2002 Addison-Wesley.