FileDocCategorySizeDatePackage
FileChooserDemo.javaAPI DocExample670Fri Jun 08 10:23:00 BST 2001None

FileChooserDemo.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.colorchooser.*;

public class FileChooserDemo extends JFrame {
  public FileChooserDemo() {
    super("FileChooserDemo");

    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Choose a file");
    this.getContentPane().add(fileChooser);
    fileChooser.show();
  }

  public static void main(String[] args) {
    JFrame frame = new FileChooserDemo();
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {System.exit(0);}
    });

    frame.pack();
    frame.setVisible(true);
  }
}