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:
java.awt.image.ImageObserver

public class FileDialog
extends Dialog

The File Dialog class displays a file selection dialog. It is a modal dialog and will block the calling thread when the show method is called to display it, until the user has chosen a file.

See Also:
Window.show()

Field Summary
static int LOAD
          The file load variable.
static int SAVE
          The file save variable.
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FileDialog(Frame parent, String title)
          Creates a file dialog for loading a file.
FileDialog(Frame parent, String title, int mode)
          Creates a file dialog with the specified title and mode.
 
Method Summary
 void addNotify()
          Creates the frame's peer.
 String getDirectory()
          Gets the directory of the Dialog.
 String getFile()
          Gets the file of the Dialog.
 FilenameFilter getFilenameFilter()
          Gets the filter.
 int getMode()
          Gets the mode of the file dialog.
protected  String paramString()
          Returns the parameter String of this file dialog.
 void setDirectory(String dir)
          Set the directory of the Dialog to the specified directory.
 void setFile(String file)
          Sets the file for this dialog to the specified file.
 void setFilenameFilter(FilenameFilter filter)
          Sets the filter for this dialog to the specified filter.
 
Methods inherited from class java.awt.Dialog
getTitle, isModal, isResizable, setResizable, setTitle
 
Methods inherited from class java.awt.Window
dispose, getToolkit, getWarningString, pack, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, countComponents, deliverEvent, getComponent, getComponents, getLayout, insets, layout, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeNotify, setLayout, validate
 
Methods inherited from class java.awt.Component
action, bounds, checkImage, checkImage, createImage, createImage, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, size, toString, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOAD

public static final int LOAD
The file load variable.

See Also:
Constant Field Values

SAVE

public static final int SAVE
The file save variable.

See Also:
Constant Field Values
Constructor Detail

FileDialog

public FileDialog(Frame parent,
                  String title)
Creates a file dialog for loading a file.

Parameters:
parent - the owner of the dialog
title - the title of the Dialog

FileDialog

public FileDialog(Frame parent,
                  String title,
                  int mode)
Creates a file dialog with the specified title and mode.

Parameters:
parent - the owner of the dialog
title - the title of the Dialog
mode - the mode of the Dialog
Method Detail

addNotify

public void addNotify()
Creates the frame's peer. The peer allows us to change the look of the file dialog without changing its functionality.

Overrides:
addNotify in class Dialog
See Also:
Container.removeNotify()

getMode

public int getMode()
Gets the mode of the file dialog.


getDirectory

public String getDirectory()
Gets the directory of the Dialog.


setDirectory

public void setDirectory(String dir)
Set the directory of the Dialog to the specified directory.

Parameters:
dir - the specific directory

getFile

public String getFile()
Gets the file of the Dialog.


setFile

public void setFile(String file)
Sets the file for this dialog to the specified file. This will become the default file if set before the dialog is shown.

Parameters:
file - the file being set

getFilenameFilter

public FilenameFilter getFilenameFilter()
Gets the filter.


setFilenameFilter

public void setFilenameFilter(FilenameFilter filter)
Sets the filter for this dialog to the specified filter.

Parameters:
filter - the specified filter

paramString

protected String paramString()
Returns the parameter String of this file dialog. Parameter String.

Overrides:
paramString in class Dialog