Creating a Progress Monitor Dialog : ProgressMonitor « Swing « Java Tutorial






import javax.swing.JFrame;
import javax.swing.ProgressMonitor;
import javax.swing.UIManager;

public class Main {
  public static void main(String[] argv) throws Exception {
    String message = "Description of Task";
    String note = "subtask";
    String title = "Task Title";
    UIManager.put("ProgressMonitor.progressText", title);

    int min = 0;
    int max = 100;
    JFrame component = new JFrame();
    ProgressMonitor pm = new ProgressMonitor(component, message, note, min, max);

    boolean cancelled = pm.isCanceled();
    if (cancelled) {
      System.out.println("Stop task");
    } else {
      pm.setProgress(100);
      pm.setNote("New Note");
    }
  }
}








14.110.ProgressMonitor
14.110.1.ProgressMonitor ClassProgressMonitor Class
14.110.2.Creating a Progress Monitor Dialog
14.110.3.Create a ProgressMonitor toolbar
14.110.4.Implement ProgressMonitor toolbar with a file to monitor
14.110.5.Customizing a ProgressMonitor Look and Feel
14.110.6.Setting the Popup Delay of a Progress Monitor Dialog
14.110.7.JAR Archives: Pack Progress Monitor