Top Description Inners Fields Constructors Methods
javax.swing

public Class ProgressMonitor

extends Object
implements Accessible
Class Inheritance
All Implemented Interfaces
javax.accessibility.Accessible
Imports
java.io.*, java.awt.BorderLayout, .Frame, .Dialog, .Window, .Component, .Container, .IllegalComponentStateException, .Point, .Rectangle, java.beans.PropertyChangeEvent, .PropertyChangeListener, java.awt.event.WindowListener, .WindowAdapter, .WindowEvent, java.text.*, java.util.Locale, javax.accessibility.*, javax.swing.event.*, javax.swing.text.*

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.

Authors
James Gosling, Lynn Monsanto (accessibility)
Since
1.2
See Also
ProgressMonitorInputStream

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
ProgressMonitor.AccessibleProgressMonitor

AccessibleProgressMonitor implements accessibility support for the ProgressMonitor class.

private class

Field Summary

Modifier and TypeField and Description
protected AccessibleContext
accessibleContext

The AccessibleContext for the ProgressMonitor

private AccessibleContext
private Object[]
private JDialog
private int
private Object
private int
private int
private int
private JProgressBar
private String
private JLabel
private JOptionPane
private Component
private ProgressMonitor
private long

Constructor Summary

AccessConstructor and Description
public
ProgressMonitor(Component
the parent component for the dialog box
parentComponent
,
Object
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.
message
,
String
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 ineffective
note
,
int
the lower bound of the range
min
,
int
the upper bound of the range
max
)

Constructs a graphic object that shows progress, typically by filling in a rectangular bar as the process nears completion.

private
ProgressMonitor(Component parentComponent, Object message, String note, int min, int max, ProgressMonitor group)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Indicate that the operation is complete.

public AccessibleContext

Returns:

the AccessibleContext for the ProgressMonitor
getAccessibleContext
()

Implements javax.accessibility.Accessible.getAccessibleContext.

Gets the AccessibleContext for the ProgressMonitor
public int

Returns:

an int representing the maximum value
getMaximum
()

Returns the maximum value -- the higher end of the progress value.

public int

Returns:

the amount of time in milliseconds this object waits before deciding whether or not to popup a progress monitor
getMillisToDecideToPopup
()

Returns the amount of time this object waits before deciding whether or not to popup a progress monitor.

public int

Returns:

the amount of time in milliseconds it will take for the popup to appear
getMillisToPopup
()

Returns the amount of time it will take for the popup to appear.

public int

Returns:

an int representing the minimum value
getMinimum
()

Returns the minimum value -- the lower end of the progress value.

public String

Returns:

a String specifying the note to display
getNote
()

Specifies the additional note that is displayed along with the progress message.

public boolean

Returns:

true if the user hits the Cancel button or closes the progress dialog
isCanceled
()

Returns true if the user hits the Cancel button or closes the progress dialog.

public void
setMaximum(int
an int specifying the maximum value
m
)

Specifies the maximum value.

public void
setMillisToDecideToPopup(int
an int specifying the time to wait, in milliseconds
millisToDecideToPopup
)

Specifies the amount of time to wait before deciding whether or not to popup a progress monitor.

public void
setMillisToPopup(int
an int specifying the time in milliseconds
millisToPopup
)

Specifies the amount of time it will take for the popup to appear.

public void
setMinimum(int
an int specifying the minimum value
m
)

Specifies the minimum value.

public void
setNote(String
a String specifying the note to display
note
)

Specifies the additional note that is displayed along with the progress message.

public void
setProgress(int
an int specifying the current value, between the maximum and minimum specified for this component
nv
)

Indicate the progress of the operation being monitored.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessibleContextback to summary
protected AccessibleContext accessibleContext

The AccessibleContext for the ProgressMonitor

Since
1.5
accessibleJOptionPaneback to summary
private AccessibleContext accessibleJOptionPane
cancelOptionback to summary
private Object[] cancelOption
dialogback to summary
private JDialog dialog
maxback to summary
private int max
messageback to summary
private Object message
millisToDecideToPopupback to summary
private int millisToDecideToPopup
millisToPopupback to summary
private int millisToPopup
minback to summary
private int min
myBarback to summary
private JProgressBar myBar
noteback to summary
private String note
noteLabelback to summary
private JLabel noteLabel
paneback to summary
private JOptionPane pane
parentComponentback to summary
private Component parentComponent
rootback to summary
private ProgressMonitor root
T0back to summary
private long T0

Constructor Detail

ProgressMonitorback to summary
public 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.

Parameters
parentComponent:Component

the parent component for the dialog box

message:Object

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:String

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 ineffective

min:int

the lower bound of the range

max:int

the upper bound of the range

See Also
JDialog, JOptionPane
ProgressMonitorback to summary
private ProgressMonitor(Component parentComponent, Object message, String note, int min, int max, ProgressMonitor group)

Method Detail

closeback to summary
public void close()

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.

getAccessibleContextback to summary
public AccessibleContext getAccessibleContext()

Implements javax.accessibility.Accessible.getAccessibleContext.

Gets the AccessibleContext for the ProgressMonitor

Returns:AccessibleContext

the AccessibleContext for the ProgressMonitor

Since
1.5
getMaximumback to summary
public int getMaximum()

Returns the maximum value -- the higher end of the progress value.

Returns:int

an int representing the maximum value

See Also
setMaximum
getMillisToDecideToPopupback to summary
public int getMillisToDecideToPopup()

Returns the amount of time this object waits before deciding whether or not to popup a progress monitor.

Returns:int

the amount of time in milliseconds this object waits before deciding whether or not to popup a progress monitor

See Also
setMillisToDecideToPopup
getMillisToPopupback to summary
public int getMillisToPopup()

Returns the amount of time it will take for the popup to appear.

Returns:int

the amount of time in milliseconds it will take for the popup to appear

See Also
setMillisToPopup
getMinimumback to summary
public int getMinimum()

Returns the minimum value -- the lower end of the progress value.

Returns:int

an int representing the minimum value

See Also
setMinimum
getNoteback to summary
public String getNote()

Specifies the additional note that is displayed along with the progress message.

Returns:String

a String specifying the note to display

See Also
setNote
isCanceledback to summary
public boolean isCanceled()

Returns true if the user hits the Cancel button or closes the progress dialog.

Returns:boolean

true if the user hits the Cancel button or closes the progress dialog

setMaximumback to summary
public void setMaximum(int m)

Specifies the maximum value.

Parameters
m:int

an int specifying the maximum value

See Also
getMaximum
setMillisToDecideToPopupback to summary
public void setMillisToDecideToPopup(int millisToDecideToPopup)

Specifies the amount of time to wait before deciding whether or not to popup a progress monitor.

Parameters
millisToDecideToPopup:int

an int specifying the time to wait, in milliseconds

See Also
getMillisToDecideToPopup
setMillisToPopupback to summary
public void setMillisToPopup(int millisToPopup)

Specifies the amount of time it will take for the popup to appear. (If the predicted time remaining is less than this time, the popup won't be displayed.)

Parameters
millisToPopup:int

an int specifying the time in milliseconds

See Also
getMillisToPopup
setMinimumback to summary
public void setMinimum(int m)

Specifies the minimum value.

Parameters
m:int

an int specifying the minimum value

See Also
getMinimum
setNoteback to summary
public void setNote(String note)

Specifies the additional note that is displayed along with the progress message. Used, for example, to show which file the is currently being copied during a multiple-file copy.

Parameters
note:String

a String specifying the note to display

See Also
getNote
setProgressback to summary
public void setProgress(int nv)

Indicate the progress of the operation being monitored. If the specified value is >= the maximum, the progress monitor is closed.

Parameters
nv:int

an int specifying the current value, between the maximum and minimum specified for this component

Annotations
@SuppressWarnings:deprecation
See Also
setMinimum, setMaximum, close
javax.swing back to summary

protected Class ProgressMonitor.AccessibleProgressMonitor

extends AccessibleContext
implements AccessibleText, ChangeListener, PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener, javax.accessibility.AccessibleText

AccessibleProgressMonitor implements accessibility support for the ProgressMonitor class.
Since
1.5

Field Summary

Modifier and TypeField and Description
private Object
Inherited from javax.accessibility.AccessibleContext:
ACCESSIBLE_ACTION_PROPERTYACCESSIBLE_ACTIVE_DESCENDANT_PROPERTYACCESSIBLE_CARET_PROPERTYACCESSIBLE_CHILD_PROPERTYACCESSIBLE_COMPONENT_BOUNDS_CHANGEDACCESSIBLE_DESCRIPTION_PROPERTYACCESSIBLE_HYPERTEXT_OFFSETACCESSIBLE_INVALIDATE_CHILDRENACCESSIBLE_NAME_PROPERTYACCESSIBLE_SELECTION_PROPERTYACCESSIBLE_STATE_PROPERTYACCESSIBLE_TABLE_CAPTION_CHANGEDACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGEDACCESSIBLE_TABLE_COLUMN_HEADER_CHANGEDACCESSIBLE_TABLE_MODEL_CHANGEDACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGEDACCESSIBLE_TABLE_ROW_HEADER_CHANGEDACCESSIBLE_TABLE_SUMMARY_CHANGEDACCESSIBLE_TEXT_ATTRIBUTES_CHANGEDACCESSIBLE_TEXT_PROPERTYACCESSIBLE_VALUE_PROPERTYACCESSIBLE_VISIBLE_DATA_PROPERTYaccessibleDescriptionaccessibleNameaccessibleParent

Constructor Summary

AccessConstructor and Description
protected
AccessibleProgressMonitor()

AccessibleProgressMonitor constructor

Method Summary

Modifier and TypeMethod and Description
public Accessible

Returns:

the Accessible child of the object
getAccessibleChild
(int
zero-based index of child
i
)

Implements abstract javax.accessibility.AccessibleContext.getAccessibleChild.

Returns the specified Accessible child of the object.
public int

Returns:

the number of accessible children of the object.
getAccessibleChildrenCount
()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleChildrenCount.

Returns the number of accessible children of the object.
public AccessibleComponent

Returns:

AccessibleComponent if supported by object; else return null
getAccessibleComponent
()

Overrides javax.accessibility.AccessibleContext.getAccessibleComponent.

Gets the AccessibleComponent associated with this object that has a graphical representation.
public String

Returns:

the localized description of the object; null if this object does not have a description
getAccessibleDescription
()

Overrides javax.accessibility.AccessibleContext.getAccessibleDescription.

Gets the accessibleDescription property of this object.
public int

Returns:

the 0-based index of this object in its parent; -1 if this object does not have an accessible parent.
getAccessibleIndexInParent
()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleIndexInParent.

Gets the 0-based index of this object in its accessible parent.
public String

Returns:

the localized name of the object; null if this object does not have a name
getAccessibleName
()

Overrides javax.accessibility.AccessibleContext.getAccessibleName.

Gets the accessibleName property of this object.
public Accessible

Returns:

the Accessible parent of this object; null if this object does not have an Accessible parent
getAccessibleParent
()

Overrides javax.accessibility.AccessibleContext.getAccessibleParent.

Gets the Accessible parent of this object.
public AccessibleRole

Returns:

an instance of AccessibleRole describing the role of the object
getAccessibleRole
()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleRole.

Gets the role of this object.
public AccessibleStateSet

Returns:

an instance of AccessibleStateSet containing the current state set of the object
getAccessibleStateSet
()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleStateSet.

Gets the state set of this object.
public AccessibleText

Returns:

AccessibleText if supported by object; else return null
getAccessibleText
()

Overrides javax.accessibility.AccessibleContext.getAccessibleText.

Gets the AccessibleText associated with this object presenting text on the display.
public AccessibleValue

Returns:

AccessibleValue if supported by object; else return null
getAccessibleValue
()

Overrides javax.accessibility.AccessibleContext.getAccessibleValue.

Gets the AccessibleValue associated with this object that supports a Numerical value.
public String

Returns:

the letter, word, or sentence
getAfterIndex
(int
the CHARACTER, WORD, or SENTENCE to retrieve
part
,
int
an index within the text
index
)

Implements javax.accessibility.AccessibleText.getAfterIndex.

Returns the String after a given index.
public String

Returns:

the letter, word, or sentence
getAtIndex
(int
the CHARACTER, WORD, or SENTENCE to retrieve
part
,
int
an index within the text
index
)

Implements javax.accessibility.AccessibleText.getAtIndex.

Returns the String at a given index.
public String

Returns:

the letter, word, or sentence
getBeforeIndex
(int
the CHARACTER, WORD, or SENTENCE to retrieve
part
,
int
an index within the text
index
)

Implements javax.accessibility.AccessibleText.getBeforeIndex.

Returns the String before a given index.
public int

Returns:

the zero-based offset of the caret.
getCaretPosition
()

Implements javax.accessibility.AccessibleText.getCaretPosition.

Returns the zero-based offset of the caret.
public AttributeSet

Returns:

the AttributeSet of the character
getCharacterAttribute
(int
the zero-based index into the text
i
)

Implements javax.accessibility.AccessibleText.getCharacterAttribute.

Returns the AttributeSet for a given character at a given index
public Rectangle

Returns:

the screen coordinates of the character's bounding box, if index is invalid return an empty rectangle.
getCharacterBounds
(int
the index into the String
i
)

Implements javax.accessibility.AccessibleText.getCharacterBounds.

Determines the bounding box of the character at the given index into the string.
public int

Returns:

the number of characters
getCharCount
()

Implements javax.accessibility.AccessibleText.getCharCount.

Returns the number of characters (valid indices)
public int

Returns:

the zero-based index of the character under Point p; if Point is invalid return -1.
getIndexAtPoint
(Point
the Point in local coordinates
p
)

Implements javax.accessibility.AccessibleText.getIndexAtPoint.

Given a point in local coordinates, return the zero-based index of the character under that Point.
public Locale

Returns:

this component's locale. If this component does not have a locale, the locale of its parent is returned.
getLocale
()

Implements abstract javax.accessibility.AccessibleContext.getLocale.

Gets the locale of the component.
private AccessibleText
private AccessibleContext
private AccessibleContext
public String

Returns:

the String portion of the text that is selected
getSelectedText
()

Implements javax.accessibility.AccessibleText.getSelectedText.

Returns the portion of the text that is selected.
public int

Returns:

the index into the text of the end of the selection
getSelectionEnd
()

Implements javax.accessibility.AccessibleText.getSelectionEnd.

Returns the end offset within the selected text.
public int

Returns:

the index into the text of the start of the selection
getSelectionStart
()

Implements javax.accessibility.AccessibleText.getSelectionStart.

Returns the start offset within the selected text.
private void
public void
propertyChange(PropertyChangeEvent
A PropertyChangeEvent object describing the event source and the property that has changed. Must not be null.
e
)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.
private boolean
public void
stateChanged(ChangeEvent
a ChangeEvent object. Must not be null.
e
)

Implements javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.
Inherited from javax.accessibility.AccessibleContext:
addPropertyChangeListenerfirePropertyChangegetAccessibleActiongetAccessibleEditableTextgetAccessibleIcongetAccessibleRelationSetgetAccessibleSelectiongetAccessibleTableremovePropertyChangeListenersetAccessibleDescriptionsetAccessibleNamesetAccessibleParent

Field Detail

oldModelValueback to summary
private Object oldModelValue

Constructor Detail

AccessibleProgressMonitorback to summary
protected AccessibleProgressMonitor()

AccessibleProgressMonitor constructor

Method Detail

getAccessibleChildback to summary
public Accessible getAccessibleChild(int i)

Implements abstract javax.accessibility.AccessibleContext.getAccessibleChild.

Returns the specified Accessible child of the object. The Accessible children of an Accessible object are zero-based, so the first child of an Accessible child is at index 0, the second child is at index 1, and so on.

Parameters
i:int

zero-based index of child

Returns:Accessible

the Accessible child of the object

See Also
getAccessibleChildrenCount
getAccessibleChildrenCountback to summary
public int getAccessibleChildrenCount()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleChildrenCount.

Returns the number of accessible children of the object.

Returns:int

the number of accessible children of the object.

getAccessibleComponentback to summary
public AccessibleComponent getAccessibleComponent()

Overrides javax.accessibility.AccessibleContext.getAccessibleComponent.

Gets the AccessibleComponent associated with this object that has a graphical representation.

Returns:AccessibleComponent

AccessibleComponent if supported by object; else return null

See Also
AccessibleComponent
getAccessibleDescriptionback to summary
public String getAccessibleDescription()

Overrides javax.accessibility.AccessibleContext.getAccessibleDescription.

Gets the accessibleDescription property of this object. The accessibleDescription property of this object is a short localized phrase describing the purpose of the object. For example, in the case of a 'Cancel' button, the accessibleDescription could be 'Ignore changes and close dialog box.'

Returns:String

the localized description of the object; null if this object does not have a description

See Also
setAccessibleDescription
getAccessibleIndexInParentback to summary
public int getAccessibleIndexInParent()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleIndexInParent.

Gets the 0-based index of this object in its accessible parent.

Returns:int

the 0-based index of this object in its parent; -1 if this object does not have an accessible parent.

See Also
getAccessibleParent, getAccessibleChildrenCount, getAccessibleChild
getAccessibleNameback to summary
public String getAccessibleName()

Overrides javax.accessibility.AccessibleContext.getAccessibleName.

Gets the accessibleName property of this object. The accessibleName property of an object is a localized String that designates the purpose of the object. For example, the accessibleName property of a label or button might be the text of the label or button itself. In the case of an object that doesn't display its name, the accessibleName should still be set. For example, in the case of a text field used to enter the name of a city, the accessibleName for the en_US locale could be 'city.'

Returns:String

the localized name of the object; null if this object does not have a name

See Also
setAccessibleName
getAccessibleParentback to summary
public Accessible getAccessibleParent()

Overrides javax.accessibility.AccessibleContext.getAccessibleParent.

Gets the Accessible parent of this object.

Returns:Accessible

the Accessible parent of this object; null if this object does not have an Accessible parent

getAccessibleRoleback to summary
public AccessibleRole getAccessibleRole()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleRole.

Gets the role of this object. The role of the object is the generic purpose or use of the class of this object. For example, the role of a push button is AccessibleRole.PUSH_BUTTON. The roles in AccessibleRole are provided so component developers can pick from a set of predefined roles. This enables assistive technologies to provide a consistent interface to various tweaked subclasses of components (e.g., use AccessibleRole.PUSH_BUTTON for all components that act like a push button) as well as distinguish between subclasses that behave differently (e.g., AccessibleRole.CHECK_BOX for check boxes and AccessibleRole.RADIO_BUTTON for radio buttons).

Note that the AccessibleRole class is also extensible, so custom component developers can define their own AccessibleRole's if the set of predefined roles is inadequate.

Returns:AccessibleRole

an instance of AccessibleRole describing the role of the object

See Also
AccessibleRole
getAccessibleStateSetback to summary
public AccessibleStateSet getAccessibleStateSet()

Implements abstract javax.accessibility.AccessibleContext.getAccessibleStateSet.

Gets the state set of this object. The AccessibleStateSet of an object is composed of a set of unique AccessibleStates. A change in the AccessibleStateSet of an object will cause a PropertyChangeEvent to be fired for the ACCESSIBLE_STATE_PROPERTY property.

Returns:AccessibleStateSet

an instance of AccessibleStateSet containing the current state set of the object

See Also
AccessibleStateSet, AccessibleState, addPropertyChangeListener
getAccessibleTextback to summary
public AccessibleText getAccessibleText()

Overrides javax.accessibility.AccessibleContext.getAccessibleText.

Gets the AccessibleText associated with this object presenting text on the display.

Returns:AccessibleText

AccessibleText if supported by object; else return null

See Also
AccessibleText
getAccessibleValueback to summary
public AccessibleValue getAccessibleValue()

Overrides javax.accessibility.AccessibleContext.getAccessibleValue.

Gets the AccessibleValue associated with this object that supports a Numerical value.

Returns:AccessibleValue

AccessibleValue if supported by object; else return null

See Also
AccessibleValue
getAfterIndexback to summary
public String getAfterIndex(int part, int index)

Implements javax.accessibility.AccessibleText.getAfterIndex.

Returns the String after a given index.

Parameters
part:int

the CHARACTER, WORD, or SENTENCE to retrieve

index:int

an index within the text

Returns:String

the letter, word, or sentence

getAtIndexback to summary
public String getAtIndex(int part, int index)

Implements javax.accessibility.AccessibleText.getAtIndex.

Returns the String at a given index.

Parameters
part:int

the CHARACTER, WORD, or SENTENCE to retrieve

index:int

an index within the text

Returns:String

the letter, word, or sentence

getBeforeIndexback to summary
public String getBeforeIndex(int part, int index)

Implements javax.accessibility.AccessibleText.getBeforeIndex.

Returns the String before a given index.

Parameters
part:int

the CHARACTER, WORD, or SENTENCE to retrieve

index:int

an index within the text

Returns:String

the letter, word, or sentence

getCaretPositionback to summary
public int getCaretPosition()

Implements javax.accessibility.AccessibleText.getCaretPosition.

Returns the zero-based offset of the caret.

Note

That to the right of the caret will have the same index value as the offset (the caret is between two characters).

Returns:int

the zero-based offset of the caret.

getCharacterAttributeback to summary
public AttributeSet getCharacterAttribute(int i)

Implements javax.accessibility.AccessibleText.getCharacterAttribute.

Returns the AttributeSet for a given character at a given index

Parameters
i:int

the zero-based index into the text

Returns:AttributeSet

the AttributeSet of the character

getCharacterBoundsback to summary
public Rectangle getCharacterBounds(int i)

Implements javax.accessibility.AccessibleText.getCharacterBounds.

Determines the bounding box of the character at the given index into the string. The bounds are returned in local coordinates. If the index is invalid an empty rectangle is returned.

Parameters
i:int

the index into the String

Returns:Rectangle

the screen coordinates of the character's bounding box, if index is invalid return an empty rectangle.

getCharCountback to summary
public int getCharCount()

Implements javax.accessibility.AccessibleText.getCharCount.

Returns the number of characters (valid indices)

Returns:int

the number of characters

getIndexAtPointback to summary
public int getIndexAtPoint(Point p)

Implements javax.accessibility.AccessibleText.getIndexAtPoint.

Given a point in local coordinates, return the zero-based index of the character under that Point. If the point is invalid, this method returns -1.

Parameters
p:Point

the Point in local coordinates

Returns:int

the zero-based index of the character under Point p; if Point is invalid return -1.

getLocaleback to summary
public Locale getLocale() throws IllegalComponentStateException

Implements abstract javax.accessibility.AccessibleContext.getLocale.

Gets the locale of the component. If the component does not have a locale, then the locale of its parent is returned.

Returns:Locale

this component's locale. If this component does not have a locale, the locale of its parent is returned.

Exceptions
IllegalComponentStateException:
If the Component does not have its own locale and has not yet been added to a containment hierarchy such that the locale can be determined from the containing parent.
getNoteLabelAccessibleTextback to summary
private AccessibleText getNoteLabelAccessibleText()
getPanelAccessibleContextback to summary
private AccessibleContext getPanelAccessibleContext()
getParentAccessibleContextback to summary
private AccessibleContext getParentAccessibleContext()
getSelectedTextback to summary
public String getSelectedText()

Implements javax.accessibility.AccessibleText.getSelectedText.

Returns the portion of the text that is selected.

Returns:String

the String portion of the text that is selected

getSelectionEndback to summary
public int getSelectionEnd()

Implements javax.accessibility.AccessibleText.getSelectionEnd.

Returns the end offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.

Returns:int

the index into the text of the end of the selection

getSelectionStartback to summary
public int getSelectionStart()

Implements javax.accessibility.AccessibleText.getSelectionStart.

Returns the start offset within the selected text. If there is no selection, but there is a caret, the start and end offsets will be the same.

Returns:int

the index into the text of the start of the selection

optionPaneCreatedback to summary
private void optionPaneCreated()
propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Parameters
e:PropertyChangeEvent

A PropertyChangeEvent object describing the event source and the property that has changed. Must not be null.

Exceptions
NullPointerException:
if the parameter is null.
sameWindowAncestorback to summary
private boolean sameWindowAncestor(Component src, Component dest)
stateChangedback to summary
public void stateChanged(ChangeEvent e)

Implements javax.swing.event.ChangeListener.stateChanged.

Invoked when the target of the listener has changed its state.

Parameters
e:ChangeEvent

a ChangeEvent object. Must not be null.

Exceptions
NullPointerException:
if the parameter is null.
javax.swing back to summary

private Class ProgressMonitor.ProgressOptionPane

extends JOptionPane
Class Inheritance
Annotations
@SuppressWarnings:serial

Field Summary

Inherited from javax.swing.JOptionPane:
CANCEL_OPTIONCLOSED_OPTIONDEFAULT_OPTIONERROR_MESSAGEiconICON_PROPERTYINFORMATION_MESSAGEINITIAL_SELECTION_VALUE_PROPERTYINITIAL_VALUE_PROPERTYinitialSelectionValueinitialValueINPUT_VALUE_PROPERTYinputValuemessageMESSAGE_PROPERTYMESSAGE_TYPE_PROPERTYmessageTypeNO_OPTIONOK_CANCEL_OPTIONOK_OPTIONOPTION_TYPE_PROPERTYoptionsOPTIONS_PROPERTYoptionTypePLAIN_MESSAGEQUESTION_MESSAGESELECTION_VALUES_PROPERTYselectionValuesUNINITIALIZED_VALUEvalueVALUE_PROPERTYWANTS_INPUT_PROPERTYwantsInputWARNING_MESSAGEYES_NO_CANCEL_OPTIONYES_NO_OPTIONYES_OPTION

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public JDialog
createDialog(Component
determines the frame in which the dialog is displayed; if the parentComponent has no Frame, a default Frame is used
parentComponent
,
String
the title string for the dialog
title
)

Overrides javax.swing.JOptionPane.createDialog.

Creates and returns a new JDialog wrapping this centered on the parentComponent in the parentComponent's frame.
public AccessibleContext

Returns:

the AccessibleContext for the ProgressOptionPane
getAccessibleContext
()

Overrides javax.swing.JOptionPane.getAccessibleContext.

Implements javax.accessibility.Accessible.getAccessibleContext.

Gets the AccessibleContext for the ProgressOptionPane
private AccessibleContext
public int
getMaxCharactersPerLineCount()

Overrides javax.swing.JOptionPane.getMaxCharactersPerLineCount.

Returns the maximum number of characters to place on a line in a message.
Inherited from javax.swing.JOptionPane:
createDialogcreateInternalFramegetDesktopPaneForComponentgetFrameForComponentgetIcongetInitialSelectionValuegetInitialValuegetInputValuegetMessagegetMessageTypegetOptionsgetOptionTypegetRootFramegetSelectionValuesgetUIgetUIClassIDgetValuegetWantsInputgetWindowForComponentparamStringselectInitialValuesetIconsetInitialSelectionValuesetInitialValuesetInputValuesetMessagesetMessageTypesetOptionssetOptionTypesetRootFramesetSelectionValuessetUIsetValuesetWantsInputshowConfirmDialogshowConfirmDialogshowConfirmDialogshowConfirmDialogshowInputDialogshowInputDialogshowInputDialogshowInputDialogshowInputDialogshowInputDialogshowInternalConfirmDialogshowInternalConfirmDialogshowInternalConfirmDialogshowInternalConfirmDialogshowInternalInputDialogshowInternalInputDialogshowInternalInputDialogshowInternalMessageDialogshowInternalMessageDialogshowInternalMessageDialogshowInternalOptionDialogshowMessageDialogshowMessageDialogshowMessageDialogshowOptionDialogupdateUI

Constructor Detail

ProgressOptionPaneback to summary
pack-priv ProgressOptionPane(Object messageList)

Method Detail

createDialogback to summary
public JDialog createDialog(Component parentComponent, String title)

Overrides javax.swing.JOptionPane.createDialog.

Doc from javax.swing.JOptionPane.createDialog.

Creates and returns a new JDialog wrapping this centered on the parentComponent in the parentComponent's frame. title is the title of the returned dialog. The returned JDialog will not be resizable by the user, however programs can invoke setResizable on the JDialog instance to change this property. The returned JDialog will be set up such that once it is closed, or the user clicks on one of the buttons, the optionpane's value property will be set accordingly and the dialog will be closed. Each time the dialog is made visible, it will reset the option pane's value property to JOptionPane.UNINITIALIZED_VALUE to ensure the user's subsequent action closes the dialog properly.

Parameters
parentComponent:Component

determines the frame in which the dialog is displayed; if the parentComponent has no Frame, a default Frame is used

title:String

the title string for the dialog

Returns:JDialog

a new JDialog containing this instance

getAccessibleContextback to summary
public AccessibleContext getAccessibleContext()

Overrides javax.swing.JOptionPane.getAccessibleContext.

Implements javax.accessibility.Accessible.getAccessibleContext.

Gets the AccessibleContext for the ProgressOptionPane

Returns:AccessibleContext

the AccessibleContext for the ProgressOptionPane

Since
1.5
getAccessibleJOptionPaneback to summary
private AccessibleContext getAccessibleJOptionPane()
getMaxCharactersPerLineCountback to summary
public int getMaxCharactersPerLineCount()

Overrides javax.swing.JOptionPane.getMaxCharactersPerLineCount.

Doc from javax.swing.JOptionPane.getMaxCharactersPerLineCount.

Returns the maximum number of characters to place on a line in a message. Default is to return Integer.MAX_VALUE. The value can be changed by overriding this method in a subclass.

Returns:int

an integer giving the maximum number of characters on a line