java.awt
Class FileDialog
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Dialog
|
+--java.awt.FileDialog
All Implemented Interfaces:
Serializable, ImageObserver, MenuContainer, Serializable
This class implements a file selection dialog box widget.
Authors:- Aaron M. Renn (arenn@urbanophile.com)
- Tom Tromey <tromey@redhat.com>
LOAD
public static final int LOAD
Indicates that the purpose of the dialog is for opening a file.
SAVE
public static final int SAVE
Indicates that the purpose of the dialog is for saving a file.
FileDialog
public FileDialog(java.awt.Frame parent)
Initializes a new instance of FileDialog
with the
specified parent. This dialog will have no title and will be for
loading a file.
Parameters:
FileDialog
public FileDialog(java.awt.Frame parent, java.lang.String title)
Initialized a new instance of FileDialog
with the
specified parent and title. This dialog will be for opening a file.
Parameters:
FileDialog
public FileDialog(java.awt.Frame parent, java.lang.String title, int mode)
Initialized a new instance of FileDialog
with the
specified parent, title, and mode.
Parameters:
Throws:
addNotify
public void addNotify()
Creates the native peer for this file dialog box.
getDirectory
public String getDirectory()
Returns the directory for this file dialog.
Returns:
- The directory for this file dialog.
getFile
public String getFile()
Returns the file that is selected in this dialog.
Returns:
- The file that is selected in this dialog.
getFilenameFilter
public FilenameFilter getFilenameFilter()
Returns the filename filter being used by this dialog.
getMode
public int getMode()
Returns the mode of this dialog, either LOAD
or
SAVE
.
Returns:
paramString
protected String paramString()
Returns a debugging string for this object.
Returns:
- A debugging string for this object.
setDirectory
public synchronized void setDirectory(java.lang.String dir)
Sets the directory for this file dialog.
Parameters:
setFile
public synchronized void setFile(java.lang.String file)
Sets the selected file for this dialog.
Parameters:
setFilenameFilter
public synchronized void setFilenameFilter(java.io.FilenameFilter filter)
Sets the filename filter used by this dialog.
Parameters:
setMode
public void setMode(int mode)
Sets the mode of this dialog to either LOAD
or
SAVE
. This method is only effective before the native
peer is created.
Parameters:
Throws: