Java Preference Put setPrefBoolean(Object context, final String key, final boolean value)

Here you can find the source of setPrefBoolean(Object context, final String key, final boolean value)

Description

set Pref Boolean

License

Open Source License

Declaration

public static void setPrefBoolean(Object context, final String key, final boolean value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.prefs.Preferences;

public class Main {
    private static Preferences prefs;

    public static void setPrefBoolean(Object context, final String key, final boolean value) {
        prefs = Preferences.userRoot().node(context.getClass().getName());
        prefs.putBoolean(key, value);/*from  w w w.ja  v a 2 s.c o  m*/
    }
}

Related

  1. putCLOB(Preferences prefs, String key, String clob)
  2. putList(String path, ArrayList list)
  3. putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def)
  4. putPrefsStrings(Preferences prefs, String key, String[] strings)
  5. setLocale(final Locale l)
  6. setUserString(final String preferencesGroup, final String preferenceName, final String value)
  7. storeDiff(Preferences prefs, String key, int prev, int val, int defVal)
  8. storeNotDef(Preferences prefs, String key, boolean val, boolean defVal)