code: private void writePreferences() {
      boolean runOnStartup = getRunOnStartupCheckBox().isSelected();
      pref.putBoolean("runOnStartup", runOnStartup);
  
      if (getLimitCpusCheckBox().isSelected()) {
        int maxCpus = ((Number) getMaxCpusTextField().getValue()).intValue();
        pref.putInt("maxCpus", maxCpus);
      } else {
        pref.putInt("maxCpus", 0);
      }
  
      boolean requireAC = getRequireACCheckBox().isSelected();
      int minBattLife = getMinBatteryLifeSlider().getValue();
      int minBattLifeWhileChg = getMinBatteryLifeWhileChargingSlider().getValue();
      pref.putBoolean("requireAC", requireAC);
      pref.putInt("minBattLife", minBattLife);
      pref.putInt("minBattLifeWhileChg", minBattLifeWhileChg);
  
      boolean cacheClassDefinitions = getCacheClassDefinitionsCheckBox().isSelected();
      pref.putBoolean("cacheClassDefinitions", cacheClassDefinitions);
    }
docs: Writes the form values to preferences.