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
-
QueryOnOverwriteStyle
- Select a file for Writing.
-
ReadStyle
- Select a file for Reading.
-
WriteStyle
- Select a file for Writing.
-
FileChooser()
-
-
FileChooser(FileChooserFilter)
-
-
ask(JFrame, String, File, FileChooserFilter, int, ChangeListener)
-
-
getFilter()
-
-
getModel()
-
-
getPreview()
-
-
getStyle()
-
-
getUI()
- Returns the file chooser's current UI.
-
isOK()
-
-
setFilter(FileChooserFilter)
- Establish a filter to use in selecting the file.
-
setModel(FileModel)
-
-
setPreview(Component)
-
-
setStyle(int)
- Set a style to be used by this dialog box.
-
setUI(FileChooser. UI)
- Sets the file chooser's UI.
-
stateChanged(ChangeEvent)
-
-
toString()
-
-
updateUI()
- Gets a new UI object from the default UIFactory.
ReadStyle
public static final int ReadStyle
- Select a file for Reading. The file must exist.
WriteStyle
public static final int WriteStyle
- Select a file for Writing. The file may or may not exist.
QueryOnOverwriteStyle
public static final int QueryOnOverwriteStyle
- Select a file for Writing. If the file already exists, the
user is queried to confirm.
FileChooser
public FileChooser(FileChooserFilter filter)
FileChooser
public FileChooser()
ask
public static File ask(JFrame parent,
String title,
File dfc,
FileChooserFilter fcf,
int style,
ChangeListener target)
toString
public String toString()
- Overrides:
- toString in class Component
setStyle
public void setStyle(int s)
- Set a style to be used by this dialog box. If not set,
WriteStyle is assumed
getStyle
public int getStyle()
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
getFilter
public FileChooserFilter getFilter()
setPreview
public void setPreview(Component p)
getPreview
public Component getPreview()
getModel
public FileModel getModel()
setModel
public void setModel(FileModel f)
getUI
public FileChooser. UI getUI()
- Returns the file chooser's current UI.
- See Also:
- setUI
setUI
public void setUI(FileChooser. UI ui)
- Sets the file chooser's UI.
- Parameters:
- ui - the new UI
- See Also:
- getUI
updateUI
public void updateUI()
- Gets a new UI object from the default UIFactory.
- Overrides:
- updateUI in class JComponent
stateChanged
public void stateChanged(ChangeEvent e)
isOK
public boolean isOK()
All Packages Class Hierarchy This Package Previous Next Index