Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
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


public class FileDialog

extends Dialog

implements Serializable

This class implements a file selection dialog box widget.

Authors:

Field Summary

static intLOAD

Indicates that the purpose of the dialog is for opening a file.
static intSAVE

Indicates that the purpose of the dialog is for saving a file.

Constructor Summary

FileDialog(java.awt.Frame parent)

Initializes a new instance of FileDialog with the specified parent.
FileDialog(java.awt.Frame parent, java.lang.String title)

Initialized a new instance of FileDialog with the specified parent and title.
FileDialog(java.awt.Frame parent, java.lang.String title, int mode)

Initialized a new instance of FileDialog with the specified parent, title, and mode.

Method Summary

voidaddNotify()

Creates the native peer for this file dialog box.
java.lang.StringgetDirectory()

Returns the directory for this file dialog.
java.lang.StringgetFile()

Returns the file that is selected in this dialog.
java.io.FilenameFiltergetFilenameFilter()

Returns the filename filter being used by this dialog.
intgetMode()

Returns the mode of this dialog, either LOAD or SAVE.
java.lang.StringparamString()

Returns a debugging string for this object.
synchronized voidsetDirectory(java.lang.String dir)

Sets the directory for this file dialog.
synchronized voidsetFile(java.lang.String file)

Sets the selected file for this dialog.
synchronized voidsetFilenameFilter(java.io.FilenameFilter filter)

Sets the filename filter used by this dialog.
voidsetMode(int mode)

Sets the mode of this dialog to either LOAD or SAVE.

Field Details

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.


Constructor Details

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:


Method Details

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:


getFile

public String getFile()

Returns the file that is selected in this dialog.

Returns:


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:


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: