Java JFileChooser .setMultiSelectionEnabled (boolean b)
Syntax
JFileChooser.setMultiSelectionEnabled(boolean b) has the following syntax.
public void setMultiSelectionEnabled(boolean b)
Example
In the following code shows how to use JFileChooser.setMultiSelectionEnabled(boolean b) method.
//from w w w .j a v a 2 s.c o m
import java.io.File;
import javax.swing.JFileChooser;
public class Main {
public static void main(String[] argv) {
JFileChooser chooser = new JFileChooser();
chooser.setMultiSelectionEnabled(true);
chooser.showOpenDialog(null);
File[] files = chooser.getSelectedFiles();
}
}
Home »
Java Tutorial »
javax.swing »
Java Tutorial »
javax.swing »