Java Utililty Methods Preference

List of utility methods to do Preference

Description

The list of methods to do Preference are organized into topic(s).

Method

voidsavePreference(String key, Object value)
save Preference
if (value instanceof String) {
    prefs.put(key, (String) value);
} else if (value instanceof Boolean) {
    prefs.putBoolean(key, (Boolean) value);
} else if (value instanceof Integer) {
    prefs.putInt(key, (Integer) value);
PreferencesuserNodeForClass(Class clazz)
user Node For Class
final Preferences prefs = Preferences.userNodeForPackage(clazz);
return prefs.node(clazz.getSimpleName());
voidwriteReg2(String name, String value, Class clazz)
write Reg
Preferences prefsdemo = Preferences.systemNodeForPackage(clazz);
try {
    prefsdemo.put(name, value);
} catch (Exception e) {