All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.ProgressMonitor

java.lang.Object
   |
   +----com.sun.java.swing.ProgressMonitor

public class ProgressMonitor
extends Object
A class to monitor the progress of some operation. If it looks like it will take a while, a progress dialog will be popped up. When it it created it is given a numeric range and a descriptive string. As the operation progresses, call the setProgress method to indicate how far along the [min,max] range the operation is. Initially, there is no ProgressDialog. After the first millisToDecideToPopup milliseconds (default 500) the progress monitor will predict how long the operation will take. If it is longer than millisToPopup (default 2000, 2 seconds) a ProgressDialog will be popped up.

See Also:
ProgressMonitorInputStream

Constructor Index

 o ProgressMonitor(JFrame, String, int, int)

Method Index

 o done()
Indicate that the operation is complete.
 o getDescription()
 o getMaximum()
 o getMillisToDecideToPopup()
 o getMillisToPopup()
 o getMinimum()
 o isCancelled()
Returns true if the user does some UI action to cancel this operation.
 o setDescription(String)
 o setMaximum(int)
 o setMillisToDecideToPopup(int)
 o setMillisToPopup(int)
 o setMinimum(int)
 o setProgress(int)
Indicate the progress of the operation being monitored.

Constructors

 o ProgressMonitor
 public ProgressMonitor(JFrame fparent,
                        String description,
                        int min,
                        int max)
Parameters:
fparent - the parent frame for the dialog box (if a dialog box is created). fparent may be null if a default parent has been established with StandardDialog
description - a description string that will be shown to the user to indicate what operation is being monitored
min - the lower bound of the range
max - the upper bound of the range
See Also:
StandardDialog

Methods

 o setProgress
 public void setProgress(int nv)
Indicate the progress of the operation being monitored.

 o done
 public void done()
Indicate that the operation is complete. This happens automatically when the value set by setProgress is >= max, but it may be called earlier if the operation ends early.

 o getMinimum
 public int getMinimum()
 o setMinimum
 public void setMinimum(int m)
 o getMaximum
 public int getMaximum()
 o setMaximum
 public void setMaximum(int m)
 o isCancelled
 public boolean isCancelled()
Returns true if the user does some UI action to cancel this operation. (like hitting the Cancel button on the progress dialog).

 o setMillisToDecideToPopup
 public void setMillisToDecideToPopup(int millisToDecideToPopup)
 o getMillisToDecideToPopup
 public int getMillisToDecideToPopup()
 o setMillisToPopup
 public void setMillisToPopup(int millisToPopup)
 o getMillisToPopup
 public int getMillisToPopup()
 o setDescription
 public void setDescription(String description)
 o getDescription
 public String getDescription()

All Packages  Class Hierarchy  This Package  Previous  Next  Index