Java Preference Put putPrefsStrings(Preferences prefs, String key, String[] strings)

Here you can find the source of putPrefsStrings(Preferences prefs, String key, String[] strings)

Description

put Prefs Strings

License

Open Source License

Declaration

public static void putPrefsStrings(Preferences prefs, String key, String[] strings) 

Method Source Code

//package com.java2s;

import java.util.prefs.Preferences;

public class Main {
    public static void putPrefsStrings(Preferences prefs, String key, String[] strings) {
        for (int i = 0; i < strings.length; i++)
            prefs.put(key + (i + 1), strings[i]);

        for (int i = strings.length; prefs.get(key + (i + 1), null) != null; i++)
            prefs.remove(key + (i + 1));
    }//from  w  ww  .j ava  2s. co  m
}

Related

  1. put(final String key, final boolean value)
  2. putBooleanDontOverwrite(Preferences prefs, String key, boolean value)
  3. putCLOB(Preferences prefs, String key, String clob)
  4. putList(String path, ArrayList list)
  5. putPrefsBoolean(Preferences prefs, String key, boolean value, boolean def)
  6. setLocale(final Locale l)
  7. setPrefBoolean(Object context, final String key, final boolean value)
  8. setUserString(final String preferencesGroup, final String preferenceName, final String value)
  9. storeDiff(Preferences prefs, String key, int prev, int val, int defVal)