Here you can find the source of createJFileChooser(String name)
Parameter | Description |
---|---|
name | a parameter |
public static JFileChooser createJFileChooser(String name)
//package com.java2s; // it under the terms of the GNU General Public License as published by // import javax.swing.*; import java.io.File; import java.util.prefs.Preferences; public class Main { /**/*from w w w. j a v a 2 s .c o m*/ * Returns a new JFileChooser properly set up for Tetrad. * * @param name */ public static JFileChooser createJFileChooser(String name) { if (name == null) { name = "Save"; } JFileChooser chooser = new JFileChooser(); String sessionSaveLocation = Preferences.userRoot().get("fileSaveLocation", ""); chooser.setCurrentDirectory(new File(sessionSaveLocation)); chooser.resetChoosableFileFilters(); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); chooser.setDialogTitle(name); return chooser; } }