FileDocCategorySizeDatePackage
JFileTyper.javaAPI DocExample752Sun Mar 28 19:08:38 BST 1999None

JFileTyper

public class JFileTyper extends Object

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

    
    JFileChooser fc = new JFileChooser();
    int result = fc.showOpenDialog(new JFrame());
    if (result == JFileChooser.APPROVE_OPTION) {
      try {
        File f = fc.getSelectedFile();
        if (f != null) { // make sure the user didn't choose a directory
          FileInputStream fin = new FileInputStream(f);
          StreamCopier.copy(fin, System.out);
          fin.close();
        }
      }
      catch (IOException e) {
        System.err.println(e);
      }
      
    }
    
    // Work around annoying AWT non-daemon thread bug
    System.exit(0);