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
-
ProgressMonitor(JFrame, String, int, int)
-
-
done()
- Indicate that the operation is complete.
-
getDescription()
-
-
getMaximum()
-
-
getMillisToDecideToPopup()
-
-
getMillisToPopup()
-
-
getMinimum()
-
-
isCancelled()
- Returns true if the user does some UI action to cancel this operation.
-
setDescription(String)
-
-
setMaximum(int)
-
-
setMillisToDecideToPopup(int)
-
-
setMillisToPopup(int)
-
-
setMinimum(int)
-
-
setProgress(int)
- Indicate the progress of the operation being monitored.
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
setProgress
public void setProgress(int nv)
- Indicate the progress of the operation being monitored.
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.
getMinimum
public int getMinimum()
setMinimum
public void setMinimum(int m)
getMaximum
public int getMaximum()
setMaximum
public void setMaximum(int m)
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).
setMillisToDecideToPopup
public void setMillisToDecideToPopup(int millisToDecideToPopup)
getMillisToDecideToPopup
public int getMillisToDecideToPopup()
setMillisToPopup
public void setMillisToPopup(int millisToPopup)
getMillisToPopup
public int getMillisToPopup()
setDescription
public void setDescription(String description)
getDescription
public String getDescription()
All Packages Class Hierarchy This Package Previous Next Index