Class FileDialog in Java

0
23
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

Class FileDialog in Java
Class FileDialog in Java

Class FileDialog in Java:

The class FileDialog displays a dialog window from which the user can select a file.It is a modal dialog hence once it’s show() method is called,it blocks the rest of the application until the user has cancelled the dialog or has chosen a file. The AWT sends the file dialog window over all the mouse ,keyboard and focus event that occurs over it.

The structure of the class FileDialog is given as:


public class java.awt.FileDialog extends java.awt.Dialog{
//member element
public final static int LOAD;
//this constant indicates that the file dialog window is intend to determine
//a file from which to read.
public final static int SAVE;
//this constant indicates that the file dialog window is intend to determine
//a file to which to write.
//constructor
public FileDialog(Frame parent,String title);
//creates a FileDialog window with the specified tile for loading a file. The files
//shown are those present in the current directory.
public FileDialog(Frame parent,String title,int mode);
//creates a FileDialog window with the specified tile for loading or saving a file. The files
//shown are those present in the current directory.The mode argument must have the value LOAD
to SAVE.The value LOAD indicates that the file dialog is finding a file to read.The value SAVE
indicates that the file dialog is finding a place to write a file.
//methods:
public void addNotify();
public void setDirectory(String dir);
public void setFile(String file);
public void setFilenameFilter(FilenameFilter filter);
public String getDirectory();
public String getFile();
public String paramString();
public int getMode();
public FilenameFilter getFilenameFilter();
}
Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here