JFileChooser: showOpenDialog(Component parent) : JFileChooser « javax.swing « Java by API






JFileChooser: showOpenDialog(Component parent)

  
import javax.swing.JFileChooser;

public class Main {

  public static void main(String[] a) {

    JFileChooser fileChooser = new JFileChooser();

    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    fileChooser.showOpenDialog(null);
  }

}

   
    
  








Related examples in the same category

1.JFileChooser.APPROVE_OPTION
2.JFileChooser.CANCEL_OPTION
3.JFileChooser.DIRECTORIES_ONLY
4.JFileChooser.DIRECTORY_CHANGED_PROPERTY
5.JFileChooser.ERROR_OPTION
6.JFileChooser.SELECTED_FILE_CHANGED_PROPERTY
7.JFileChooser.SELECTED_FILES_CHANGED_PROPERTY
8.JFileChooser: addActionListener(ActionListener l)
9.JFileChooser: addChoosableFileFilter(FileFilter filter)
10.JFileChooser: addPropertyChangeListener(PropertyChangeListener listener)
11.JFileChooser: createDialog(Component parent)
12.JFileChooser: getCurrentDirectory()
13.JFileChooser: getFileSystemView()
14.JFileChooser: getSelectedFile()
15.JFileChooser: getTypeDescription(File f)
16.JFileChooser: isFileHidingEnabled()
17.JFileChooser: setAccessory(JComponent newAccessory)
18.JFileChooser: setApproveButtonMnemonic(char mnemonic)
19.JFileChooser: setApproveButtonText(String approveButtonText)
20.JFileChooser: setApproveButtonToolTipText(String toolTipText)
21.JFileChooser: setControlButtonsAreShown(boolean b)
22.JFileChooser: setCurrentDirectory(File dir)
23.JFileChooser: setFileFilter(FileFilter filter)
24.JFileChooser: setFileHidingEnabled(boolean b)
25.JFileChooser: setFileSelectionMode(int mode)
26.JFileChooser: setFileView(FileView fileView)
27.JFileChooser: setMultiSelectionEnabled(boolean b)
28.JFileChooser: setSelectedFile(File file)