java.awt
Class FileDialog

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by java.awt.FileDialog
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FileDialog
extends Dialog
implements Serializable

This class implements a file selection dialog box widget.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int LOAD
          Indicates that the purpose of the dialog is for opening a file.
static int SAVE
          Indicates that the purpose of the dialog is for saving a file.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FileDialog(Dialog parent)
          Initializes a new instance of FileDialog with the specified parent.
FileDialog(Dialog parent, String title)
          Initialized a new instance of FileDialog with the specified parent and title.
FileDialog(Dialog parent, String title, int mode)
          Initialized a new instance of FileDialog with the specified parent, title, and mode.
FileDialog(Frame parent)
          Initializes a new instance of FileDialog with the specified parent.
FileDialog(Frame parent, String title)
          Initialized a new instance of FileDialog with the specified parent and title.
FileDialog(Frame parent, String title, int mode)
          Initialized a new instance of FileDialog with the specified parent, title, and mode.
 
Method Summary
 void addNotify()
          Creates the native peer for this file dialog box.
 String getDirectory()
          Returns the directory for this file dialog.
 String getFile()
          Returns the file that is selected in this dialog.
 FilenameFilter getFilenameFilter()
          Returns the filename filter being used by this dialog.
 int getMode()
          Returns the mode of this dialog, either LOAD or SAVE.
protected  String paramString()
          Returns a debugging string for this object.
 void setDirectory(String dir)
          Sets the directory for this file dialog.
 void setFile(String file)
          Sets the selected file for this dialog.
 void setFilenameFilter(FilenameFilter filter)
          Sets the filename filter used by this dialog.
 void setMode(int mode)
          Sets the mode of this dialog to either LOAD or SAVE.
 
Methods inherited from class java.awt.Dialog
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
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
Indicates that the purpose of the dialog is for opening a file.

See Also:
Constant Field Values

SAVE

public static final int SAVE
Indicates that the purpose of the dialog is for saving a file.

See Also:
Constant Field Values
Constructor Detail

FileDialog

public FileDialog(Dialog 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:
parent - The parent dialog for this.
Since:
1.5

FileDialog

public FileDialog(Dialog parent,
                  String title)
Initialized a new instance of FileDialog with the specified parent and title. This dialog will be for opening a file.

Parameters:
parent - The parent dialog for this.
title - The title for this dialog.
Since:
1.5

FileDialog

public FileDialog(Dialog parent,
                  String title,
                  int mode)
Initialized a new instance of FileDialog with the specified parent, title, and mode.

Parameters:
parent - The parent dialog for this.
title - The title for this dialog.
mode - The mode of the dialog, either LOAD or SAVE.
Throws:
IllegalArgumentException - - if illegal mode, if GraphicsEnvironment.isHeadless or if parent is null.
Since:
1.5

FileDialog

public FileDialog(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:
parent - The parent frame for this dialog.

FileDialog

public FileDialog(Frame parent,
                  String title)
Initialized a new instance of FileDialog with the specified parent and title. This dialog will be for opening a file.

Parameters:
parent - The parent frame for this dialog.
title - The title for this dialog.

FileDialog

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

Parameters:
parent - The parent frame for this dialog.
title - The title for this dialog.
mode - The mode of the dialog, either LOAD or SAVE.
Throws:
IllegalArgumentException - If an illegal file dialog mode is supplied.
Method Detail

getMode

public int getMode()
Returns the mode of this dialog, either LOAD or SAVE.

Returns:
The mode of this dialog.

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:
mode - The new mode of this file dialog.
Throws:
IllegalArgumentException - If an illegal file dialog mode is supplied.

getDirectory

public String getDirectory()
Returns the directory for this file dialog.

Returns:
The directory for this file dialog.

setDirectory

public void setDirectory(String dir)
Sets the directory for this file dialog.

Parameters:
dir - The new 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.

setFile

public void setFile(String file)
Sets the selected file for this dialog.

Parameters:
file - The selected file for this dialog.

getFilenameFilter

public FilenameFilter getFilenameFilter()
Returns the filename filter being used by this dialog.

Returns:
The filename filter being used by this dialog.

setFilenameFilter

public void setFilenameFilter(FilenameFilter filter)
Sets the filename filter used by this dialog.

Parameters:
filter - The new filename filter for this file dialog box.

addNotify

public void addNotify()
Creates the native peer for this file dialog box.

Overrides:
addNotify in class Dialog
See Also:
Component.isDisplayable(), Component.removeNotify()

paramString

protected String paramString()
Returns a debugging string for this object.

Overrides:
paramString in class Dialog
Returns:
A debugging string for this object.