public class FileDialog extends Dialog implements Serializable
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeWindow.AccessibleAWTWindowContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
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.
|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
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. |
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, showaddWindowFocusListener, 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, toFrontadd, 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, validateTreeaction, 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, transferFocusUpCyclepublic static final int LOAD
public static final int SAVE
public FileDialog(Dialog parent)
FileDialog with the specified
parent. This dialog will have no title and will be for loading a file.parent - The parent dialog for this.public FileDialog(Dialog parent, String title)
FileDialog with the
specified parent and title. This dialog will be for opening a file.parent - The parent dialog for this.title - The title for this dialog.public FileDialog(Dialog parent, String title, int mode)
FileDialog with the specified
parent, title, and mode.parent - The parent dialog for this.title - The title for this dialog.mode - The mode of the dialog, either LOAD or
SAVE.IllegalArgumentException - - if illegal mode, if
GraphicsEnvironment.isHeadless or if parent is null.public FileDialog(Frame parent)
FileDialog with the
specified parent. This dialog will have no title and will be for
loading a file.parent - The parent frame for this dialog.public FileDialog(Frame parent, String title)
FileDialog with the
specified parent and title. This dialog will be for opening a file.parent - The parent frame for this dialog.title - The title for this dialog.public FileDialog(Frame parent, String title, int mode)
FileDialog with the
specified parent, title, and mode.parent - The parent frame for this dialog.title - The title for this dialog.mode - The mode of the dialog, either LOAD or
SAVE.IllegalArgumentException - If an illegal file dialog mode
is supplied.public int getMode()
LOAD or
SAVE.public void setMode(int mode)
LOAD or
SAVE. This method is only effective before the native
peer is created.mode - The new mode of this file dialog.IllegalArgumentException - If an illegal file dialog mode
is supplied.public String getDirectory()
public void setDirectory(String dir)
dir - The new directory for this file dialog.public String getFile()
public void setFile(String file)
file - The selected file for this dialog.public FilenameFilter getFilenameFilter()
public void setFilenameFilter(FilenameFilter filter)
filter - The new filename filter for this file dialog box.public void addNotify()
addNotify in class DialogComponent.isDisplayable(),
Component.removeNotify()protected String paramString()
paramString in class Dialog