Java JFileChooser .getTypeDescription (File f)
Syntax
JFileChooser.getTypeDescription(File f) has the following syntax.
public String getTypeDescription(File f)
Example
In the following code shows how to use JFileChooser.getTypeDescription(File f) method.
//w w w . j av a 2 s . co m
import java.io.File;
import javax.swing.JFileChooser;
public class Main {
public static void main(String[] argv) {
JFileChooser chooser = new JFileChooser();
File file = new File("filename.txt");
String fileTypeName = chooser.getTypeDescription(file);
}
}
Home »
Java Tutorial »
javax.swing »
Java Tutorial »
javax.swing »