Source Code : ProgressMonitorInputStream Demo

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

ProgressMonitorInputStream Demo

 
import java.awt.Color;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;

import javax.swing.JLabel;
import javax.swing.ProgressMonitorInputStream;

public class ProgressInputSample {
  public static final int NORMAL = 0;

  public static void main(String args[]) throws Exception {
    int returnValue = NORMAL;
    if (args.length != 1) {
      System.err.println("Usage:");
      System.err.println("java ProgressInput filename");
    } else {
      FileInputStream fis = new FileInputStream(args[0]);
      JLabel filenameLabel = new JLabel(args[0], JLabel.RIGHT);
      filenameLabel.setForeground(Color.black);
      Object message[] = { "Reading:", filenameLabel };
      ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(null, message, fis);
      InputStreamReader isr = new InputStreamReader(pmis);
      BufferedReader br = new BufferedReader(isr);
      String line;
      while ((line = br.readLine()) != null) {
        System.out.println(line);
        Thread.sleep(500);
      }
      br.close();
    }
    // AWT Thread created - must exit
    System.exit(returnValue);
  }
}

           
         
  

Thank with us