private void savePrefs() {
    SikuliIDE ide = SikuliIDE.getInstance();
    pref.setCaptureDelay((Double) _spnDelay.getValue());
    pref.setCaptureHotkey(_cap_hkey);
    pref.setCaptureHotkeyModifiers(_cap_mod);
    pref.setAutoNamingMethod(
        _radTimestamp.isSelected()
            ? UserPreferences.AUTO_NAMING_TIMESTAMP
            : _radOCR.isSelected()
                ? UserPreferences.AUTO_NAMING_OCR
                : UserPreferences.AUTO_NAMING_OFF);
    if (_old_cap_hkey != _cap_hkey || _old_cap_mod != _cap_mod) {
      ide.removeCaptureHotkey(_old_cap_hkey, _old_cap_mod);
      ide.installCaptureHotkey(_cap_hkey, _cap_mod);
    }
    pref.setCheckUpdate(_chkAutoUpdate.isSelected());

    pref.setExpandTab(_chkExpandTab.isSelected());
    pref.setTabWidth((Integer) _spnTabWidth.getValue());

    pref.setFontName((String) _cmbFontName.getSelectedItem());
    pref.setFontSize((Integer) _spnFontSize.getValue());

    Locale locale = (Locale) _cmbLang.getSelectedItem();
    pref.setLocale(locale);
    I18N.setLocale(locale);
  }