code: public void setPreference(String prefKey, String prefValue) {
          props.setProperty(prefKey, prefValue);
          savePreferences();
      }
docs: Sets the value of the specified preference in the properties file
  
  @param prefKey   The key of the preference to save
  @param prefValue The value of the preference to save