Displaying Only Directories in a File Chooser Dialog - Java Swing

Java examples for Swing:JFileChooser

Description

Displaying Only Directories in a File Chooser Dialog

Demo Code

import java.io.File;

import javax.swing.JFileChooser;

public class Main {
  public static void main(String[] argv) {
    JFileChooser fileChooser = new JFileChooser(new File(""));
    fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
  }/* w  ww  .  j a  va2 s . c o  m*/

}

Related Tutorials