GetFileType

JFileChooser chooser = new JFileChooser();

// Create a File instance of the file
File file = new File("filename.txt");

// Get the file type name
String fileTypeName = chooser.getTypeDescription(file);
// Text Document

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.