| java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog java.awt.FileDialog
FileDialog | public class FileDialog extends Dialog (Code) | | The FileDialog class displays a dialog window
from which the user can select a file.
Since it is a modal dialog, when the application calls
its show method to display the dialog,
it blocks the rest of the application until the user has
chosen a file.
See Also: Window.show version: 1.16, 08/19/02 author: Sami Shaio author: Arthur van Hoff since: JDK1.0 |
Field Summary | |
final public static int | LOAD This constant value indicates that the purpose of the file
dialog window is to locate a file from which to read. | final public static int | SAVE This constant value indicates that the purpose of the file
dialog window is to locate a file to which to write. | String | dir The string specifying the directory to display
in the file dialog. | String | file The string specifying the initial value of the
filename text field in the file dialog. | FilenameFilter | filter The filter used as the file dialog's filename filter. | int | mode There are 2 FileDialog Modes : LOAD and
SAVE. |
Constructor Summary | |
public | FileDialog(Frame parent) Creates a file dialog for loading a file. | public | FileDialog(Frame parent, String title) Creates a file dialog window with the specified title for loading
a file. | public | FileDialog(Frame parent, String title, int mode) Creates a file dialog window with the specified title for loading
or saving a file.
If the value of mode is LOAD , then the
file dialog is finding a file to read. |
LOAD | final public static int LOAD(Code) | | This constant value indicates that the purpose of the file
dialog window is to locate a file from which to read.
|
SAVE | final public static int SAVE(Code) | | This constant value indicates that the purpose of the file
dialog window is to locate a file to which to write.
|
dir | String dir(Code) | | The string specifying the directory to display
in the file dialog.
This variable may be null.
See Also: getDirectory() See Also: setDirectory() |
file | String file(Code) | | The string specifying the initial value of the
filename text field in the file dialog.
This variable may be null.
See Also: getFile() See Also: setFile() |
filter | FilenameFilter filter(Code) | | The filter used as the file dialog's filename filter.
The file dialog will only be displaying files whose
names are accepted by this filter.
This variable may be null.
See Also: getFilenameFIlter() See Also: setFilenameFilter() See Also: FileNameFilter |
mode | int mode(Code) | | There are 2 FileDialog Modes : LOAD and
SAVE.
This integer will represent one or the other.
If the mode is not specified it will default to LOAD.
See Also: getMode() See Also: setMode() See Also: java.awt.FileDialog.LOAD See Also: java.awt.FileDialog.SAVE |
FileDialog | public FileDialog(Frame parent)(Code) | | Creates a file dialog for loading a file. The title of the
file dialog is initially empty.
Parameters: parent - the owner of the dialog since: JDK1.1 |
FileDialog | public FileDialog(Frame parent, String title)(Code) | | Creates a file dialog window with the specified title for loading
a file. The files shown are those in the current directory.
Parameters: parent - the owner of the dialog. Parameters: title - the title of the dialog. |
FileDialog | public FileDialog(Frame parent, String title, int mode)(Code) | | Creates a file dialog window with the specified title for loading
or saving a file.
If the value of mode is LOAD , then the
file dialog is finding a file to read. If the value of
mode is SAVE , the file dialog is finding
a place to write a file.
Parameters: parent - the owner of the dialog. Parameters: title - the title of the dialog. Parameters: mode - the mode of the dialog. See Also: java.awt.FileDialog.LOAD See Also: java.awt.FileDialog.SAVE |
addNotify | public void addNotify()(Code) | | Creates the file dialog's peer. The peer allows us to change the look
of the file dialog without changing its functionality.
|
constructComponentName | String constructComponentName()(Code) | | Construct a name for this component. Called by getName() when the
name is null.
|
getFile | public String getFile()(Code) | | Gets the selected file of this file dialog.
the currently selected file of this file dialog window,or null if none is selected. See Also: java.awt.FileDialog.setFile |
getFilenameFilter | public FilenameFilter getFilenameFilter()(Code) | | Determines this file dialog's filename filter. A filename filter
allows the user to specify which files appear in the file dialog
window. Filename filters do not function in Sun's reference
implementation for Windows 95, 98, or NT 4.0.
this file dialog's filename filter. See Also: java.io.FilenameFilter See Also: java.awt.FileDialog.setFilenameFilter |
paramString | protected String paramString()(Code) | | Returns the parameter string representing the state of this file
dialog window. This string is useful for debugging.
the parameter string of this file dialog window. |
postsOldMouseEvents | boolean postsOldMouseEvents()(Code) | | |
setDirectory | public void setDirectory(String dir)(Code) | | Sets the directory of this file dialog window to be the
specified directory. Specifying a null or an
invalid directory implies an implementation-defined default.
This default will not be realized, however, until the user
has selected a file. Until this point, getDirectory()
will return the value passed into this method.
Specifying "" as the directory is exactly equivalent to
specifying null as the directory.
Parameters: dir - the specific directory. See Also: java.awt.FileDialog.getDirectory |
setFile | public void setFile(String file)(Code) | | Sets the selected file for this file dialog window to be the
specified file. This file becomes the default file if it is set
before the file dialog window is first shown. Specifying "" as
the file is exactly equivalent to specifying null
as the file.
Parameters: file - the file being set. See Also: java.awt.FileDialog.getFile |
Methods inherited from java.awt.Container | public Component add(Component comp)(Code)(Java Doc) public Component add(String name, Component comp)(Code)(Java Doc) public Component add(Component comp, int index)(Code)(Java Doc) public void add(Component comp, Object constraints)(Code)(Java Doc) public void add(Component comp, Object constraints, int index)(Code)(Java Doc) public synchronized void addContainerListener(ContainerListener l)(Code)(Java Doc) protected void addImpl(Component comp, Object constraints, int index)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) public int countComponents()(Code)(Java Doc) public void deliverEvent(Event e)(Code)(Java Doc) public void doLayout()(Code)(Java Doc) boolean eventEnabled(AWTEvent e)(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public Component getComponent(int n)(Code)(Java Doc) public Component getComponentAt(int x, int y)(Code)(Java Doc) public Component getComponentAt(Point p)(Code)(Java Doc) public int getComponentCount()(Code)(Java Doc) public Component[] getComponents()(Code)(Java Doc) public Insets getInsets()(Code)(Java Doc) public LayoutManager getLayout()(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) Window getWindow()(Code)(Java Doc) public Insets insets()(Code)(Java Doc) public void invalidate()(Code)(Java Doc) public boolean isAncestorOf(Component c)(Code)(Java Doc) public void layout()(Code)(Java Doc) void lightweightPrint(Graphics g)(Code)(Java Doc) public void list(PrintStream out, int indent)(Code)(Java Doc) public void list(PrintWriter out, int indent)(Code)(Java Doc) public Component locate(int x, int y)(Code)(Java Doc) public Dimension minimumSize()(Code)(Java Doc) void nextFocus(Component base)(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) public void paintComponents(Graphics g)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public Dimension preferredSize()(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printComponents(Graphics g)(Code)(Java Doc) protected void processContainerEvent(ContainerEvent e)(Code)(Java Doc) protected void processEvent(AWTEvent e)(Code)(Java Doc) public void remove(int index)(Code)(Java Doc) public void remove(Component comp)(Code)(Java Doc) public void removeAll()(Code)(Java Doc) public synchronized void removeContainerListener(ContainerListener l)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public void setLayout(LayoutManager mgr)(Code)(Java Doc) void transferFocus(Component base)(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void validate()(Code)(Java Doc) protected void validateTree()(Code)(Java Doc)
|
Methods inherited from java.awt.Component | public boolean action(Event evt, Object what)(Code)(Java Doc) public synchronized void add(PopupMenu popup)(Code)(Java Doc) public synchronized void addComponentListener(ComponentListener l)(Code)(Java Doc) public synchronized void addFocusListener(FocusListener l)(Code)(Java Doc) public synchronized void addKeyListener(KeyListener l)(Code)(Java Doc) public synchronized void addMouseListener(MouseListener l)(Code)(Java Doc) public synchronized void addMouseMotionListener(MouseMotionListener l)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) boolean areInputMethodsEnabled()(Code)(Java Doc) public Rectangle bounds()(Code)(Java Doc) final void checkEnableNewEventsOnly(Object listener)(Code)(Java Doc) public int checkImage(Image image, ImageObserver observer)(Code)(Java Doc) public int checkImage(Image image, int width, int height, ImageObserver observer)(Code)(Java Doc) protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent)(Code)(Java Doc) String constructComponentName()(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public boolean contains(Point p)(Code)(Java Doc) public Image createImage(ImageProducer producer)(Code)(Java Doc) public Image createImage(int width, int height)(Code)(Java Doc) ComponentXWindow createXWindow()(Code)(Java Doc) public void deliverEvent(Event e)(Code)(Java Doc) public void disable()(Code)(Java Doc) final protected void disableEvents(long eventsToDisable)(Code)(Java Doc) final public void dispatchEvent(AWTEvent e)(Code)(Java Doc) void dispatchEventImpl(AWTEvent e)(Code)(Java Doc) public void doLayout()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void enable(boolean b)(Code)(Java Doc) final protected synchronized void enableEvents(long eventsToEnable)(Code)(Java Doc) boolean eventEnabled(AWTEvent e)(Code)(Java Doc) Component findFocusDelegate(Container container)(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public Color getBackground()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Component getComponentAt(int x, int y)(Code)(Java Doc) public Component getComponentAt(Point p)(Code)(Java Doc) public Cursor getCursor()(Code)(Java Doc) Component getFocusDelegate()(Code)(Java Doc) public Font getFont()(Code)(Java Doc) Component getFontAndColorDelegate()(Code)(Java Doc) public FontMetrics getFontMetrics(Font font)(Code)(Java Doc) public Color getForeground()(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) InputContext getInputContext()(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Point getLocation()(Code)(Java Doc) public Point getLocationOnScreen()(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public String getName()(Code)(Java Doc) Container getNativeContainer()(Code)(Java Doc) public Container getParent()(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) public Dimension getSize()(Code)(Java Doc) public Toolkit getToolkit()(Code)(Java Doc) final public Object getTreeLock()(Code)(Java Doc) public boolean gotFocus(Event evt, Object what)(Code)(Java Doc) public boolean handleEvent(Event evt)(Code)(Java Doc) public void hide()(Code)(Java Doc) public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)(Code)(Java Doc) public boolean inside(int x, int y)(Code)(Java Doc) public void invalidate()(Code)(Java Doc) static void invokeAndWait(Runnable runnable)(Code)(Java Doc) public boolean isDisplayable()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isFocusTraversable()(Code)(Java Doc) public boolean isLightweight()(Code)(Java Doc) boolean isLightweightWhenDisplayable()(Code)(Java Doc) public boolean isOpaque()(Code)(Java Doc) public boolean isShowing()(Code)(Java Doc) public boolean isValid()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) public boolean keyDown(Event evt, int key)(Code)(Java Doc) public boolean keyUp(Event evt, int key)(Code)(Java Doc) public void layout()(Code)(Java Doc) void lightweightPrint(Graphics g)(Code)(Java Doc) public void list()(Code)(Java Doc) public void list(PrintStream out)(Code)(Java Doc) public void list(PrintStream out, int indent)(Code)(Java Doc) public void list(PrintWriter out)(Code)(Java Doc) public void list(PrintWriter out, int indent)(Code)(Java Doc) public Component locate(int x, int y)(Code)(Java Doc) public Point location()(Code)(Java Doc) public boolean lostFocus(Event evt, Object what)(Code)(Java Doc) public Dimension minimumSize()(Code)(Java Doc) public boolean mouseDown(Event evt, int x, int y)(Code)(Java Doc) public boolean mouseDrag(Event evt, int x, int y)(Code)(Java Doc) public boolean mouseEnter(Event evt, int x, int y)(Code)(Java Doc) public boolean mouseExit(Event evt, int x, int y)(Code)(Java Doc) public boolean mouseMove(Event evt, int x, int y)(Code)(Java Doc) public boolean mouseUp(Event evt, int x, int y)(Code)(Java Doc) public void move(int x, int y)(Code)(Java Doc) public void nextFocus()(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) public void paintAll(Graphics g)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public boolean postEvent(Event e)(Code)(Java Doc) public Dimension preferredSize()(Code)(Java Doc) public boolean prepareImage(Image image, ImageObserver observer)(Code)(Java Doc) public boolean prepareImage(Image image, int width, int height, ImageObserver observer)(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printAll(Graphics g)(Code)(Java Doc) protected void processComponentEvent(ComponentEvent e)(Code)(Java Doc) protected void processEvent(AWTEvent e)(Code)(Java Doc) protected void processFocusEvent(FocusEvent e)(Code)(Java Doc) protected void processKeyEvent(KeyEvent e)(Code)(Java Doc) protected void processMouseEvent(MouseEvent e)(Code)(Java Doc) protected void processMouseMotionEvent(MouseEvent e)(Code)(Java Doc) public synchronized void remove(MenuComponent popup)(Code)(Java Doc) public synchronized void removeComponentListener(ComponentListener l)(Code)(Java Doc) public synchronized void removeFocusListener(FocusListener l)(Code)(Java Doc) public synchronized void removeKeyListener(KeyListener l)(Code)(Java Doc) public synchronized void removeMouseListener(MouseListener l)(Code)(Java Doc) public synchronized void removeMouseMotionListener(MouseMotionListener l)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public void repaint()(Code)(Java Doc) public void repaint(long tm)(Code)(Java Doc) public void repaint(int x, int y, int width, int height)(Code)(Java Doc) public void repaint(long tm, int x, int y, int width, int height)(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public void reshape(int x, int y, int width, int height)(Code)(Java Doc) public void resize(int width, int height)(Code)(Java Doc) public void resize(Dimension d)(Code)(Java Doc) public void setBackground(Color c)(Code)(Java Doc) public void setBounds(int x, int y, int width, int height)(Code)(Java Doc) public void setBounds(Rectangle r)(Code)(Java Doc) public synchronized void setCursor(Cursor cursor)(Code)(Java Doc) public void setEnabled(boolean b)(Code)(Java Doc) public void setFont(Font f)(Code)(Java Doc) public void setForeground(Color c)(Code)(Java Doc) public void setLocale(Locale l)(Code)(Java Doc) public void setLocation(int x, int y)(Code)(Java Doc) public void setLocation(Point p)(Code)(Java Doc) public void setName(String name)(Code)(Java Doc) public void setSize(int width, int height)(Code)(Java Doc) public void setSize(Dimension d)(Code)(Java Doc) public void setVisible(boolean b)(Code)(Java Doc) public void show()(Code)(Java Doc) public void show(boolean b)(Code)(Java Doc) public Dimension size()(Code)(Java Doc) public String toString()(Code)(Java Doc) public void transferFocus()(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void validate()(Code)(Java Doc)
|
|
|