Package net.sf.gridarta.utils
Class FileChooserUtils
- java.lang.Object
-
- net.sf.gridarta.utils.FileChooserUtils
-
public class FileChooserUtils extends java.lang.ObjectUtility class forJFileChooserrelated functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidsanitizeCurrentDirectory(@NotNull javax.swing.JFileChooser fileChooser)Makes sure the current directory of aJFileChooseris valid.static voidsetCurrentDirectory(@NotNull javax.swing.JFileChooser fileChooser, @Nullable java.io.File dir)CallsJFileChooser.setCurrentDirectory(File).
-
-
-
Method Detail
-
setCurrentDirectory
public static void setCurrentDirectory(@NotNull @NotNull javax.swing.JFileChooser fileChooser, @Nullable @Nullable java.io.File dir)CallsJFileChooser.setCurrentDirectory(File). Makes sure the passed directory exists to minimize the chance forNullPointerExceptions. See Bugreport 4869950.- Parameters:
fileChooser- the file chooser to affectdir- the directory to set;null=user's home directory
-
sanitizeCurrentDirectory
public static void sanitizeCurrentDirectory(@NotNull @NotNull javax.swing.JFileChooser fileChooser)Makes sure the current directory of aJFileChooseris valid.- Parameters:
fileChooser- the file chooser to check
-
-