java.lang.Objectjavax.swing.ProgressMonitor
public class ProgressMonitor
A class to monitor the progress of some operation. If it looks like the operation will take a while, a progress dialog will be popped up. When the ProgressMonitor is 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.
From time to time, when the Dialog box is visible, the progress bar will be updated when setProgress is called. setProgress won't always update the progress bar, it will only be done if the amount of progress is visibly significant.
For further documentation and examples see How to Monitor Progress , a section in The Java Tutorial.
Nested Class Summary | |
---|---|
protected class |
ProgressMonitor.AccessibleProgressMonitor
AccessibleProgressMonitor implements accessibility support for the ProgressMonitor class. |
Field Summary | |
---|---|
protected AccessibleContext |
accessibleContext
![]() ![]() |
Constructor Summary | |
---|---|
ProgressMonitor
(
Component
parentComponent,
Object
message,
String
note, int min, int max) Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion. |
Method Summary | |
---|---|
void |
close
() Indicate that the operation is complete. |
AccessibleContext |
getAccessibleContext
() Gets the AccessibleContext for the ProgressMonitor |
int |
getMaximum
() Returns the maximum value -- the higher end of the progress value. |
int |
getMillisToDecideToPopup
() Returns the amount of time this object waits before deciding whether or not to popup a progress monitor. |
int |
getMillisToPopup
() Returns the amount of time it will take for the popup to appear. |
int |
getMinimum
() Returns the minimum value -- the lower end of the progress value. |
String |
getNote
() Specifies the additional note that is displayed along with the progress message. |
boolean |
isCanceled
() Returns true if the user hits the Cancel button in the progress dialog. |
void |
setMaximum
(int m) Specifies the maximum value. |
void |
setMillisToDecideToPopup
(int millisToDecideToPopup) Specifies the amount of time to wait before deciding whether or not to popup a progress monitor. |
void |
setMillisToPopup
(int millisToPopup) Specifies the amount of time it will take for the popup to appear. |
void |
setMinimum
(int m) Specifies the minimum value. |
void |
setNote
(
String
note) Specifies the additional note that is displayed along with the progress message. |
void |
setProgress
(int nv) Indicate the progress of the operation being monitored. |
Methods inherited from class java.lang. Object |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
Field Detail |
---|
protected AccessibleContext accessibleContext
Constructor Detail |
---|
public ProgressMonitor(Component parentComponent, Object message, String note, int min, int max)
Method Detail |
---|
public void setProgress(int nv)
public void close()
public int getMinimum()
public void setMinimum(int m)
public int getMaximum()
public void setMaximum(int m)
public boolean isCanceled()
public void setMillisToDecideToPopup(int millisToDecideToPopup)
public int getMillisToDecideToPopup()
public void setMillisToPopup(int millisToPopup)
public int getMillisToPopup()
public void setNote(String note)
public String getNote()
public AccessibleContext getAccessibleContext()