Class SimpleDirectoryChooser

  • All Implemented Interfaces:
    FileChooser, ImageObserver, MenuContainer, Serializable, nz.ac.waikato.cms.adams.simpledirectorychooser.events.DirectoryChangeListener

    public class SimpleDirectoryChooser
    extends nz.ac.waikato.cms.adams.simpledirectorychooser.SimpleDirectoryChooser
    implements FileChooser
    A more intuitive dialog for selecting a directory than JFileChooser.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • SimpleDirectoryChooser

        public SimpleDirectoryChooser()
        Constructs a SimpleDirectoryChooser pointing to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
      • SimpleDirectoryChooser

        public SimpleDirectoryChooser​(String currentDirectoryPath)
        Constructs a SimpleDirectoryChooser using the given path. Passing in a null string causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
        Parameters:
        currentDirectoryPath - a String giving the path to a file or directory
      • SimpleDirectoryChooser

        public SimpleDirectoryChooser​(File currentDirectory)
        Constructs a SimpleDirectoryChooser using the given File as the path. Passing in a null file causes the file chooser to point to the user's default directory. This default depends on the operating system. It is typically the "My Documents" folder on Windows, and the user's home directory on Unix.
        Parameters:
        currentDirectory - a File object specifying the path to a file or directory
    • Method Detail

      • initWidgets

        protected void initWidgets()
        Initializes the widgets.
        Overrides:
        initWidgets in class nz.ac.waikato.cms.adams.simpledirectorychooser.SimpleDirectoryChooser
      • getDefaultAccessoryDimension

        protected Dimension getDefaultAccessoryDimension()
        Returns the preferred dimension.
        Returns:
        the dimension, null if to use default
      • isJComponent

        public boolean isJComponent()
        Returns whether the file chooser is a JComponent and can be embedded in other components.
        Specified by:
        isJComponent in interface FileChooser
        Returns:
        true if JComponent-derived