Implement ProgressMonitor toolbar with a file to monitor : ProgressMonitor « Swing JFC « Java






Implement ProgressMonitor toolbar with a file to monitor

 

import java.io.FileInputStream;

import javax.swing.ProgressMonitorInputStream;

public class Main {

  public static void main(String args[]) throws Exception {
    ProgressMonitorInputStream monitor;

    monitor = new ProgressMonitorInputStream(null, "Loading ", new FileInputStream("fileName.txt"));

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

   
  








Related examples in the same category

1.Setting the Popup Delay of a Progress Monitor Dialog
2.Creating a Progress Monitor Dialog
3.Create a ProgressMonitor toolbar
4.A program to test a progress monitor input stream.A program to test a progress monitor input stream.
5.A program to test a progress monitor dialog.