Class SelectFile

java.lang.Object
org.harctoolbox.guicomponents.SelectFile

public class SelectFile extends Object
This class packs a number of file selectors.
  • Method Details

    • saveString

      public static final String saveString()
    • restoreFromString

      public static final void restoreFromString(String string)
    • selectFile

      public static File selectFile(Component parent, String title, String defaultdir, boolean save, boolean showHiddenFiles, String fileTypeDesc, String extension)
      Version of the file selector with exactly one file extension.
      Parameters:
      parent -
      title -
      save -
      defaultdir -
      showHiddenFiles -
      extension -
      fileTypeDesc -
      Returns:
      Selected File, or null.
    • selectFile

      public static File selectFile(Component parent, String title, String defaultdir, boolean save, boolean showHiddenFiles, int mode, String fileTypeDesc, String extension)
    • selectFile

      public static File selectFile(Component parent, String title, String defaultdir, boolean save, boolean showHiddenFiles, int mode, String[]... filetypes)
      Encapsulates a file selector. The finally selected direcory will be remembered, and used as initial directory for subsequent invocations with the same title.
      Parameters:
      parent - Component, to which the popup will be positioned.
      title - Title of the popup. Also identifies the file selector.
      save - True iff the file is to be written.
      defaultdir - Default direcory if not stored in the class' static memory.
      showHiddenFiles - If true show also "hidden files".
      mode - the type of files to be displayed: JFileChooser.FILES_ONLY, JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_AND_DIRECTORIES.
      filetypes - Variable number of file extensions, as pair of strings.
      Returns:
      Selected File, or null.