Class FileSelector

All Implemented Interfaces:
FocusListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class FileSelector extends JPanel implements FocusListener
Composite component to allow file or directory input or selection. Comprises a JTextField, and a browse button associated with a JFileChooser.
See Also:
  • Constructor Details

    • FileSelector

      public FileSelector(String initialValue, String fileChooserTitle, int selectionMode)
      Instantiates a new file selector.
      Parameters:
      initialValue - the initial value
      fileChooserTitle - the file chooser title
      selectionMode - the selection mode
    • FileSelector

      public FileSelector(String initialValue, String fileChooserTitle, int selectionMode, File currentDir)
      Instantiates a new file selector.
      Parameters:
      initialValue - the initial value
      fileChooserTitle - the file chooser title
      selectionMode - the selection mode
      currentDir - the current dir
  • Method Details

    • addFileSelectorListener

      public void addFileSelectorListener(FileSelectorListener aFileSelectorListener)
      Adds the file selector listener.
      Parameters:
      aFileSelectorListener - the a file selector listener
    • addFocusListener

      public void addFocusListener(FocusListener fl)
      Overrides:
      addFocusListener in class Component
    • addChoosableFileFilter

      public void addChoosableFileFilter(FileFilter ff)
      Adds the choosable file filter.
      Parameters:
      ff - the ff
    • getSelected

      public String getSelected()
      Gets the selected.
      Returns:
      the selected
    • setSelected

      public void setSelected(String s)
      Sets the selected.
      Parameters:
      s - the new selected
    • setEnabled

      public void setEnabled(boolean onOff)
      Overrides:
      setEnabled in class JComponent
    • clear

      public void clear()
      Clear.
    • focusGained

      public void focusGained(FocusEvent aEvent)
      Specified by:
      focusGained in interface FocusListener
    • focusLost

      public void focusLost(FocusEvent aEvent)
      Specified by:
      focusLost in interface FocusListener
    • addDocumentListener

      public void addDocumentListener(DocumentListener l)
      Adds the document listener.
      Parameters:
      l - the l
    • removeDocumentListener

      public void removeDocumentListener(DocumentListener l)
      Removes the document listener.
      Parameters:
      l - the l