code: public final void saveModel() {
  
  		// File chooser
  		FileChooser fileChooser = new FileChooser();
  		fileChooser.setTitle("Save configuration file");
  		fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("daJLab json files", "*.json"));
  
  		// Setting the previous file path
  		Preferences prefs = Preferences.userNodeForPackage(DajlabModel.class);
  		String filePath = prefs.get(PREVIOUS_FILE_PATH, null);
  		if (filePath != null) {
  			fileChooser.setInitialDirectory(new File(filePath));
  		}
  		File file = fileChooser.showSaveDialog(getWindow());
  		if (file != null) {
  			prefs.put(PREVIOUS_FILE_PATH, file.getParentFile().getPath());
  			// Saving the model
  			ModelManager.saveModel(file, getModel());
  		}
  	}
docs: Open a file chooser and save the model into the selected file.<br>
  The format is json. Be aware of limitations for
  serialization/deserialization of your model.