All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.FileChooser

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.FileChooser

public class FileChooser
extends JComponent
implements ChangeListener, StandardDialog. OKcheck
A component to use for choosing a file. It is usually used through either its ask method as a dialog box, or through the ask method of an appropriate preview class.

See Also:
AudioPreview, ImagePreview, TextPreview, StandardDialog

Variable Index

 o QueryOnOverwriteStyle
Select a file for Writing.
 o ReadStyle
Select a file for Reading.
 o WriteStyle
Select a file for Writing.

Constructor Index

 o FileChooser()
 o FileChooser(FileChooserFilter)

Method Index

 o ask(JFrame, String, File, FileChooserFilter, int, ChangeListener)
 o getFilter()
 o getModel()
 o getPreview()
 o getStyle()
 o getUI()
Returns the file chooser's current UI.
 o isOK()
 o setFilter(FileChooserFilter)
Establish a filter to use in selecting the file.
 o setModel(FileModel)
 o setPreview(Component)
 o setStyle(int)
Set a style to be used by this dialog box.
 o setUI(FileChooser. UI)
Sets the file chooser's UI.
 o stateChanged(ChangeEvent)
 o toString()
 o updateUI()
Gets a new UI object from the default UIFactory.

Variables

 o ReadStyle
 public static final int ReadStyle
Select a file for Reading. The file must exist.

 o WriteStyle
 public static final int WriteStyle
Select a file for Writing. The file may or may not exist.

 o QueryOnOverwriteStyle
 public static final int QueryOnOverwriteStyle
Select a file for Writing. If the file already exists, the user is queried to confirm.

Constructors

 o FileChooser
 public FileChooser(FileChooserFilter filter)
 o FileChooser
 public FileChooser()

Methods

 o ask
 public static File ask(JFrame parent,
                        String title,
                        File dfc,
                        FileChooserFilter fcf,
                        int style,
                        ChangeListener target)
 o toString
 public String toString()
Overrides:
toString in class Component
 o setStyle
 public void setStyle(int s)
Set a style to be used by this dialog box. If not set, WriteStyle is assumed

 o getStyle
 public int getStyle()
 o setFilter
 public void setFilter(FileChooserFilter fcf)
Establish a filter to use in selecting the file. A special case is the filter FileChooserFilter.getDirectoryFilter() which can be used to specify that you're asking for a directory

 o getFilter
 public FileChooserFilter getFilter()
 o setPreview
 public void setPreview(Component p)
 o getPreview
 public Component getPreview()
 o getModel
 public FileModel getModel()
 o setModel
 public void setModel(FileModel f)
 o getUI
 public FileChooser. UI getUI()
Returns the file chooser's current UI.

See Also:
setUI
 o setUI
 public void setUI(FileChooser. UI ui)
Sets the file chooser's UI.

Parameters:
ui - the new UI
See Also:
getUI
 o updateUI
 public void updateUI()
Gets a new UI object from the default UIFactory.

Overrides:
updateUI in class JComponent
 o stateChanged
 public void stateChanged(ChangeEvent e)
 o isOK
 public boolean isOK()

All Packages  Class Hierarchy  This Package  Previous  Next  Index