I want to create a new file while file type is choosing by the user on JFileChooser. How this is possible. I use this code for JFileChooser:
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle("Save data in your file format");
FileFilter type1 = new ExtensionFilter("Access 2007 Database(*.accdb)", ".accdb");
FileFilter type2 = new ExtensionFilter("Access 2002-2003 Database(*.mdb)", ".mdb");
chooser.addChoosableFileFilter(type1);
chooser.addChoosableFileFilter(type2);
int actionDialog = chooser.showSaveDialog(frame);
Now I an able to get the "File Name" when the user select any file by this code:
chooser.getSelectedFile().getName();
But I dont know how to get "Files of type" when user select any file.
For the convenience I also attach photo of JFileChooser: