FileDocCategorySizeDatePackage
ProgressMonitorInputExample.javaAPI DocExample870Mon Nov 09 12:45:54 GMT 1998None

ProgressMonitorInputExample

public class ProgressMonitorInputExample extends JPanel

Fields Summary
Constructors Summary
public ProgressMonitorInputExample(String filename)


    ProgressMonitorInputStream monitor;

    try {
      monitor = new ProgressMonitorInputStream(
        this, "Loading "+filename, new FileInputStream(filename));

      InputStream in = new BufferedInputStream(monitor);

      while (in.available() > 0) {
        byte[] data = new byte[38];
        in.read(data);
        System.out.write(data);
      }

    } catch (FileNotFoundException e) {
      JOptionPane.showMessageDialog(null, "Unable to find file: "
        + filename, "Error", JOptionPane.ERROR_MESSAGE);
    } catch (IOException e) {;}

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

    new ProgressMonitorInputExample(args[0]);