There are basically three methods or mechanisms in java which can be used to select files or folders. These are as follow: 1) JFileChooser : JFileChooser provides a simple mechanism for the user to choose a file or folder. Here is the hierarchy of JFileChoose class. java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JFileChooser Example : final JFrame frame = new JFrame(); JFileChooser chooser = new JFileChooser(); //If you want any folder or files to be selected by default use this //JFileChooser chooser = new JFileChooser("C:\\Users\\sshankar\\Desktop\\ftp"); //To select only folders use this //chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); //Code to select files of a particular extensions ExampleFileFilter filter = new ExampleFileFilter(); filter.addExtension("jpg"); filter.addExtension("gif"); filter.setDescription("JP...