Accessible
public class ProgressMonitor extends Object implements Accessible
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.
Modifier and Type | Class | Description |
---|---|---|
protected class |
ProgressMonitor.AccessibleProgressMonitor |
AccessibleProgressMonitor implements accessibility support for the ProgressMonitor class. |
Modifier and Type | Field | Description |
---|---|---|
protected AccessibleContext |
accessibleContext |
The AccessibleContext for the ProgressMonitor
|
Constructor | Description |
---|---|
ProgressMonitor |
Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion. |
Modifier and Type | Method | Description |
---|---|---|
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 or closes the progress dialog. |
void |
setMaximum |
Specifies the maximum value. |
void |
setMillisToDecideToPopup |
Specifies the amount of time to wait before deciding whether or not to popup a progress monitor. |
void |
setMillisToPopup |
Specifies the amount of time it will take for the popup to appear. |
void |
setMinimum |
Specifies the minimum value. |
void |
setNote |
Specifies the additional note that is displayed along with the progress message. |
void |
setProgress |
Indicate the progress of the operation being monitored. |
protected AccessibleContext accessibleContext
AccessibleContext
for the ProgressMonitor
public ProgressMonitor(Component parentComponent, Object message, String note, int min, int max)
parentComponent
- the parent component for the dialog boxmessage
- a descriptive message that will be shown to the user to indicate what operation is being monitored. This does not change as the operation progresses. See the message parameters to methods in JOptionPane.message
for the range of values.note
- a short note describing the state of the operation. As the operation progresses, you can call setNote to change the note displayed. This is used, for example, in operations that iterate through a list of files to show the name of the file being processes. If note is initially null, there will be no note line in the dialog box and setNote will be ineffectivemin
- the lower bound of the rangemax
- the upper bound of the rangepublic void setProgress(int nv)
nv
- an int specifying the current value, between the maximum and minimum specified for this componentpublic void close()
public int getMinimum()
public void setMinimum(int m)
m
- an int specifying the minimum valuepublic int getMaximum()
public void setMaximum(int m)
m
- an int specifying the maximum valuepublic boolean isCanceled()
public void setMillisToDecideToPopup(int millisToDecideToPopup)
millisToDecideToPopup
- an int specifying the time to wait, in millisecondspublic int getMillisToDecideToPopup()
public void setMillisToPopup(int millisToPopup)
millisToPopup
- an int specifying the time in millisecondspublic int getMillisToPopup()
public void setNote(String note)
note
- a String specifying the note to displaypublic String getNote()
public AccessibleContext getAccessibleContext()
AccessibleContext
for the ProgressMonitor
getAccessibleContext
in interface Accessible
AccessibleContext
for the ProgressMonitor
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/ProgressMonitor.html