The FileDialog Class
The FileDialog class is part of the AWT, a child of Dialog, and allows applications with a window interface to allow the user to “browse” the file system to select a file and directory.
- fd = new FileDialog( parent, “title”, FileDialog.LOAD)
- where the parent is the frame that created this dialog box
- “title” is the title of the window
- FileDialog.LOAD specifies that the dialog box is to show files that can be loaded, one can also use FileDialog.SAVE to specify that the dialog box is to show files that can be written.
FileDialog methods getFile() and getDirectory() can return the file and directory that the user selected or specified.