JFileChooser Example In Java Swing
Chapter:
Swing
Last Updated:
26-07-2016 07:45:58 UTC
Program:
/* ............... START ............... */
import javax.swing.JFileChooser;
import javax.swing.JFrame;
public class JavaJFileChooserExample extends JFrame {
public JavaJFileChooserExample() {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setDialogTitle("Choose a file");
this.getContentPane().add(fileChooser);
fileChooser.setVisible(true);
}
public static void main(String[] args) {
JFrame frame = new JavaJFileChooserExample();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
}
/* ............... END ............... */
Output
Tags
JFileChooser Example, Swing, Java