FileDocCategorySizeDatePackage
JavaChooser.javaAPI DocExample775Sun Mar 28 19:08:36 BST 1999None

JavaChooser

public class JavaChooser extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    
    JFileChooser fc = new JFileChooser();
    fc.addChoosableFileFilter(new JavaFilter());
    int result = fc.showOpenDialog(new JFrame());
    if (result == JFileChooser.APPROVE_OPTION) {
      try {
        File f = fc.getSelectedFile();
        if (f != null) {
          FileInputStream fin = new FileInputStream(f);
          StreamCopier.copy(fin, System.out);
          fin.close();
        }
      }
      catch (IOException e) {
        System.err.println(e);
      }
      
    }
    
    System.exit(0);