private void storeSettings() throws FileNotFoundException { File f = null; if (newFile.isSelected()) { if (!newNameTf.getText().isEmpty()) { f = new File(newNameTf.getText()); } // else { // return; // Nothing to do. // } } else { f = new File(personalFile.getText()); } if (f != null) { if (!f.exists()) { throw new FileNotFoundException(f.getAbsolutePath()); } try (FileWriter fw = new FileWriter(f, false)) { for (JournalEntry entry : tableModel.getJournals()) { fw.write(entry.name); fw.write(" = "); fw.write(entry.abbreviation); fw.write(Globals.NEWLINE); } } catch (IOException e) { LOGGER.warn("Problem writing abbreviation file", e); } String filename = f.getPath(); if ("".equals(filename)) { filename = null; } Globals.prefs.put(JabRefPreferences.PERSONAL_JOURNAL_LIST, filename); } // Store the list of external files set up: List<String> extFiles = new ArrayList<>(); for (ExternalFileEntry efe : externals) { if (!"".equals(efe.getValue())) { extFiles.add(efe.getValue()); } } Globals.prefs.putStringList(JabRefPreferences.EXTERNAL_JOURNAL_LISTS, extFiles); Abbreviations.initializeJournalNames(Globals.prefs); // Update the autocompleter for the "journal" field in all base panels, // so added journal names are available: for (int i = 0; i < frame.getBasePanelCount(); i++) { frame.getBasePanelAt(i).getAutoCompleters().addJournalListToAutoCompleter(); } }