How does WebCream determine the name of the downloaded file when emulating JFileChooser Save dialog?
WebCream calls JFileChooser.getSelectedFile() method to determine the name of the file. If the method returns null, WebCream uses the default download.txt file name. Thus, be sure to set the default file name to the JFileChooser as shown below: JFileChooser chooser = new JFileChooser(); chooser.setApproveButtonText(“Select file for export”); chooser.setSelectedFile(new File(“application_export.txt”)); int returnVal = chooser.showSaveDialog(this); if(returnVal == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); // Save data to the selected file …
Related Questions
- I downloaded a file, and it contains the file extensions .rar, .r01, .r02 and others like it. What do I do with it?
- How does AjaxSwing determine the name of the downloaded file when emulating JFileChooser Save dialog?
- How does WebCream determine the name of the downloaded file when emulating JFileChooser Save dialog?