5 Replies Latest reply: May 12, 2012 8:35 AM by JohnHendrikx RSS

    Problems with ExtensionFilter

    936835
      I have the following code
      FileChooser chooser = new FileChooser();
      FileChooser.ExtensionFilter ext = new FileChooser.ExtensionFilter("Text document", "*.txt");
      chooser.getExtensionFilters().add(ext);
      File file = chooser.showSaveDialog(stage);
      So, after I've clicked on the save button, newly created file isn't in the .txt format, but "Type of file field" says - "File". How to fix this?