Class FilePicker

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FilePicker extends JPanel
A FilePicker panel similar to Scijava's File widget but adopting SNT's FileChooser.
See Also:
  • Field Details

  • Constructor Details

    • FilePicker

      public FilePicker(int fileChooserType, File initialFile, String... allowedExtensions)
      Default FilePicker constructor.
      Parameters:
      fileChooserType - Either OPEN_DIALOG or SAVE_DIALOG
      initialFile - File path to be displayed when panel is shown. Optional. null allowed.
      allowedExtensions - Allowed file extensions in FileChooser. If "/" is included then FileChooser allows selection of both files and directories. Optional. null allowed.
  • Method Details

    • getFile

      public File getFile()
    • setLabel

      public void setLabel(String label)
      Sets the File Picker label
      Parameters:
      label - the TextField label
    • setFileChooserTitle

      public void setFileChooserTitle(String title)
      Sets the FileChooser title
      Parameters:
      title - the FileChooser title
    • addListener

      public void addListener(DocumentListener dl)