Class SwingFileChooser

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javafx.embed.swing.JFXPanel
net.raumzeitfalle.fx.filechooser.SwingFileChooser
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class SwingFileChooser extends javafx.embed.swing.JFXPanel
See Also:
  • Field Details

    • CANCEL_OPTION

      public static final int CANCEL_OPTION
      Return value if cancel is chosen.
      See Also:
    • APPROVE_OPTION

      public static final int APPROVE_OPTION
      Return value if approve (yes, ok) is chosen.
      See Also:
  • Method Details

    • setUseJavaFxDirectoryChooser

      public static void setUseJavaFxDirectoryChooser(boolean toggle)
    • create

      public static SwingFileChooser create(Skin skin, PathFilter... filter)
      Creates a new FileChooser within a Swing JDialog window. File browsing will start in current working directory.
      Parameters:
      skin - Skin Defines the visual appearance of FileChooser. Defaults to dark skin.
      filter - PathFilter argument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.
      Returns:
      A configured SwingFileChooser.
    • create

      public static SwingFileChooser create(Skin skin, String title, PathFilter... filter)
      Creates a new FileChooser within a Swing JDialog window. File browsing will start in current working directory.
      Parameters:
      skin - Skin Defines the visual appearance of FileChooser. Defaults to dark skin.
      title - String title of the FileChooser view. In case of having the JavaFX based DirectoryChooser configured, the window titles for the directory and file choosers will be identical.
      filter - PathFilter argument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.
      Returns:
      A configured SwingFileChooser.
    • create

      public static SwingFileChooser create(Skin skin, String title, String pathToBrowse, PathFilter... filter)
      Creates a new FileChooser within a Swing JDialog window.
      Parameters:
      skin - Skin Defines the visual appearance of FileChooser. Defaults to dark skin.
      title - String title of the FileChooser view. In case of having the JavaFX based DirectoryChooser configured, the window titles for the directory and file choosers will be identical.
      pathToBrowse - Path Location to start file browsing in. If the argument is null or the denoted location does not exist, the control will default to current working directory.
      filter - PathFilter argument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.
      Returns:
      A configured SwingFileChooser.
    • create

      public static SwingFileChooser create(Skin skin, String title, String dirChooserTitle, String pathToBrowse, PathFilter... filter)
      Creates a new FileChooser within a Swing JDialog window.
      Parameters:
      skin - Skin Defines the visual appearance of FileChooser. Defaults to dark skin.
      title - String title of the FileChooser view
      dirChooserTitle - String title of the DirectoryChooser view when enabled. By default, the same title is used as for the FileChooser view.
      pathToBrowse - Path Location to start file browsing in. If the argument is null or the denoted location does not exist, the control will default to current working directory.
      filter - PathFilter argument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.
      Returns:
      A configured SwingFileChooser.
    • showOpenDialog

      public int showOpenDialog(Component parent)
    • getSelectedFile

      public File getSelectedFile()
    • closeView

      public void closeView()
    • addLocations

      public void addLocations(List<Location> locations)
    • setTitle

      protected void setTitle(String newTitle)