On this page
Class JSpinner.AccessibleJSpinner
- All Implemented Interfaces:
- Serializable,- EventListener,- AccessibleAction,- AccessibleComponent,- AccessibleEditableText,- AccessibleExtendedComponent,- AccessibleText,- AccessibleValue,- ChangeListener
- Enclosing class:
- 
     JSpinner
protected class JSpinner.AccessibleJSpinner extends JComponent.AccessibleJComponent implements AccessibleValue, AccessibleAction, AccessibleText, AccessibleEditableText, ChangeListenerAccessibleJSpinner implements accessibility support for the JSpinner class.
   - Since:
- 1.5
Nested Class Summary
Nested classes/interfaces declared in class javax.swing.JComponent.AccessibleJComponent
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler
    Nested classes/interfaces declared in class java.awt.Component.AccessibleAWTComponent
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
    Field Summary
Fields declared in class javax.swing.JComponent.AccessibleJComponent
accessibleFocusHandler
    Fields declared in class java.awt.Container.AccessibleAWTContainer
accessibleContainerHandler
    Fields declared in class java.awt.Component.AccessibleAWTComponent
accessibleAWTComponentHandler, accessibleAWTFocusHandler
    Fields declared in class javax.accessibility.AccessibleContext
ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_COMPONENT_BOUNDS_CHANGED, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_HYPERTEXT_OFFSET, ACCESSIBLE_INVALIDATE_CHILDREN, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_ATTRIBUTES_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent
    Fields declared in interface javax.accessibility.AccessibleAction
CLICK, DECREMENT, INCREMENT, TOGGLE_EXPAND, TOGGLE_POPUP
    Fields declared in interface javax.accessibility.AccessibleText
CHARACTER, SENTENCE, WORD
    Constructor Summary
| Modifier | Constructor | Description | 
|---|---|---|
| protected  | 
          AccessibleJSpinner constructor
          | 
Method Summary
| Modifier and Type | Method | Description | 
|---|---|---|
| void | cut | 
            Cuts the text between two indices into the system clipboard.
            | 
| void | delete | 
            Deletes the text between two indices
            | 
| boolean | doAccessibleAction | 
            Performs the specified Action on the object
            | 
| AccessibleAction | getAccessibleAction() | 
            Gets the AccessibleAction associated with this object that supports one or more actions.
            | 
| int | getAccessibleActionCount() | 
            Returns the number of accessible actions available in this object If there are more than one, the first one is considered the "default" action of the object.
            | 
| String | getAccessibleActionDescription | 
            Returns a description of the specified action of the object.
            | 
| Accessible | getAccessibleChild | 
            Returns the specified Accessible child of the object.
            | 
| int | getAccessibleChildrenCount() | 
            Returns the number of accessible children of the object.
            | 
| AccessibleRole | getAccessibleRole() | 
            Gets the role of this object.
            | 
| AccessibleText | getAccessibleText() | 
            Gets the AccessibleText associated with this object presenting text on the display.
            | 
| AccessibleValue | getAccessibleValue() | 
            Gets the AccessibleValue associated with this object.
            | 
| String | getAfterIndex | 
            Returns the String after a given index.
            | 
| String | getAtIndex | 
            Returns the String at a given index.
            | 
| String | getBeforeIndex | 
            Returns the String before a given index.
            | 
| int | getCaretPosition() | 
            Returns the zero-based offset of the caret.
            | 
| AttributeSet | getCharacterAttribute | 
            Returns the AttributeSet for a given character at a given index
            | 
| Rectangle | getCharacterBounds | 
            Determines the bounding box of the character at the given index into the string.
            | 
| int | getCharCount() | 
            Returns the number of characters (valid indices)
            | 
| Number | getCurrentAccessibleValue() | 
            Get the value of this object as a Number.
            | 
| int | getIndexAtPoint | 
            Given a point in local coordinates, return the zero-based index of the character under that Point.
            | 
| Number | getMaximumAccessibleValue() | 
            Get the maximum value of this object as a Number.
            | 
| Number | getMinimumAccessibleValue() | 
            Get the minimum value of this object as a Number.
            | 
| String | getSelectedText() | 
            Returns the portion of the text that is selected.
            | 
| int | getSelectionEnd() | 
            Returns the end offset within the selected text.
            | 
| int | getSelectionStart() | 
            Returns the start offset within the selected text.
            | 
| String | getTextRange | 
            Returns the text string between two indices.
            | 
| void | insertTextAtIndex | 
            Inserts the specified string at the given index/
            | 
| void | paste | 
            Pastes the text from the system clipboard into the text starting at the specified index.
            | 
| void | replaceText | 
            Replaces the text between two indices with the specified string.
            | 
| void | selectText | 
            Selects the text between two indices.
            | 
| void | setAttributes | 
            Sets attributes for the text between two indices.
            | 
| boolean | setCurrentAccessibleValue | 
            Set the value of this object as a Number.
            | 
| void | setTextContents | 
            Sets the text contents to the specified string.
            | 
| void | stateChanged | 
            Invoked when the target of the listener has changed its state.
            | 
Methods declared in class javax.swing.JComponent.AccessibleJComponent
addPropertyChangeListener, getAccessibleDescription, getAccessibleKeyBinding, getAccessibleName, getAccessibleStateSet, getBorderTitle, getTitledBorderText, getToolTipText, removePropertyChangeListener
    Methods declared in class java.awt.Container.AccessibleAWTContainer
getAccessibleAt
    Methods declared in class java.awt.Component.AccessibleAWTComponent
addFocusListener, contains, getAccessibleComponent, getAccessibleIndexInParent, getAccessibleParent, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
    Methods declared in class javax.accessibility.AccessibleContext
firePropertyChange, getAccessibleEditableText, getAccessibleIcon, getAccessibleRelationSet, getAccessibleSelection, getAccessibleTable, setAccessibleDescription, setAccessibleName, setAccessibleParent
    Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Methods declared in interface javax.accessibility.AccessibleComponent
addFocusListener, contains, getAccessibleAt, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
    Constructor Details
AccessibleJSpinner
protected AccessibleJSpinner()Method Details
stateChanged
public void stateChanged(ChangeEvent e)- Specified by:
- stateChangedin interface- ChangeListener
- Parameters:
- e- a- ChangeEventobject. Must not be null.
- Throws:
- NullPointerException- if the parameter is null.
getAccessibleRole
public AccessibleRole getAccessibleRole()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.
- Overrides:
- getAccessibleRolein class- JComponent.AccessibleJComponent
- Returns:
- an instance of AccessibleRole describing the role of the object
- See Also:
getAccessibleChildrenCount
public int getAccessibleChildrenCount()- Overrides:
- getAccessibleChildrenCountin class- JComponent.AccessibleJComponent
- Returns:
- the number of accessible children of the object.
getAccessibleChild
public Accessible getAccessibleChild(int i)- Overrides:
- getAccessibleChildin class- JComponent.AccessibleJComponent
- Parameters:
- i- zero-based index of child
- Returns:
- the Accessible child of the object
- See Also:
getAccessibleAction
public AccessibleAction getAccessibleAction()- Overrides:
- getAccessibleActionin class- AccessibleContext
- Returns:
- AccessibleAction if supported by object; else return null
- See Also:
getAccessibleText
public AccessibleText getAccessibleText()- Overrides:
- getAccessibleTextin class- AccessibleContext
- Returns:
- AccessibleText if supported by object; else return null
- See Also:
getAccessibleValue
public AccessibleValue getAccessibleValue()- Overrides:
- getAccessibleValuein class- AccessibleContext
- Returns:
- AccessibleValue if supported by object; else return null
- See Also:
getCurrentAccessibleValue
public Number getCurrentAccessibleValue()- Specified by:
- getCurrentAccessibleValuein interface- AccessibleValue
- Returns:
- value of the object
- See Also:
setCurrentAccessibleValue
public boolean setCurrentAccessibleValue(Number n)- Specified by:
- setCurrentAccessibleValuein interface- AccessibleValue
- Parameters:
- n- the value to set for this object
- Returns:
- true if the value was set; else False
- See Also:
getMinimumAccessibleValue
public Number getMinimumAccessibleValue()- Specified by:
- getMinimumAccessibleValuein interface- AccessibleValue
- Returns:
- Minimum value of the object; null if this object does not have a minimum value
- See Also:
getMaximumAccessibleValue
public Number getMaximumAccessibleValue()- Specified by:
- getMaximumAccessibleValuein interface- AccessibleValue
- Returns:
- Maximum value of the object; null if this object does not have a maximum value
- See Also:
getAccessibleActionCount
public int getAccessibleActionCount()- Specified by:
- getAccessibleActionCountin interface- AccessibleAction
- Returns:
- the zero-based number of Actions in this object
getAccessibleActionDescription
public String getAccessibleActionDescription(int i)- Specified by:
- getAccessibleActionDescriptionin interface- AccessibleAction
- Parameters:
- i- zero-based index of the actions
- Returns:
- a String description of the action
- See Also:
doAccessibleAction
public boolean doAccessibleAction(int i)- Specified by:
- doAccessibleActionin interface- AccessibleAction
- Parameters:
- i- zero-based index of actions. The first action (index 0) is AccessibleAction.INCREMENT and the second action (index 1) is AccessibleAction.DECREMENT.
- Returns:
- true if the action was performed; otherwise false.
- See Also:
getIndexAtPoint
public int getIndexAtPoint(Point p)- Specified by:
- getIndexAtPointin interface- AccessibleText
- Parameters:
- p- the Point in local coordinates
- Returns:
- the zero-based index of the character under Point p; if Point is invalid return -1.
getCharacterBounds
public Rectangle getCharacterBounds(int i)- Specified by:
- getCharacterBoundsin interface- AccessibleText
- Parameters:
- i- the index into the String
- Returns:
- the screen coordinates of the character's bounding box, if index is invalid return an empty rectangle.
getCharCount
public int getCharCount()- Specified by:
- getCharCountin interface- AccessibleText
- Returns:
- the number of characters
getCaretPosition
public int getCaretPosition()- Specified by:
- getCaretPositionin interface- AccessibleText
- Returns:
- the zero-based offset of the caret.
getAtIndex
public String getAtIndex(int part, int index)- Specified by:
- getAtIndexin interface- AccessibleText
- Parameters:
- part- the CHARACTER, WORD, or SENTENCE to retrieve
- index- an index within the text
- Returns:
- the letter, word, or sentence
getAfterIndex
public String getAfterIndex(int part, int index)- Specified by:
- getAfterIndexin interface- AccessibleText
- Parameters:
- part- the CHARACTER, WORD, or SENTENCE to retrieve
- index- an index within the text
- Returns:
- the letter, word, or sentence
getBeforeIndex
public String getBeforeIndex(int part, int index)- Specified by:
- getBeforeIndexin interface- AccessibleText
- Parameters:
- part- the CHARACTER, WORD, or SENTENCE to retrieve
- index- an index within the text
- Returns:
- the letter, word, or sentence
getCharacterAttribute
public AttributeSet getCharacterAttribute(int i)- Specified by:
- getCharacterAttributein interface- AccessibleText
- Parameters:
- i- the zero-based index into the text
- Returns:
- the AttributeSet of the character
getSelectionStart
public int getSelectionStart()- Specified by:
- getSelectionStartin interface- AccessibleText
- Returns:
- the index into the text of the start of the selection
getSelectionEnd
public int getSelectionEnd()- Specified by:
- getSelectionEndin interface- AccessibleText
- Returns:
- the index into the text of the end of the selection
getSelectedText
public String getSelectedText()- Specified by:
- getSelectedTextin interface- AccessibleText
- Returns:
- the String portion of the text that is selected
setTextContents
public void setTextContents(String s)- Specified by:
- setTextContentsin interface- AccessibleEditableText
- Parameters:
- s- the string to set the text contents
insertTextAtIndex
public void insertTextAtIndex(int index, String s)- Specified by:
- insertTextAtIndexin interface- AccessibleEditableText
- Parameters:
- index- the index in the text where the string will be inserted
- s- the string to insert in the text
getTextRange
public String getTextRange(int startIndex, int endIndex)- Specified by:
- getTextRangein interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
- Returns:
- the text string between the indices
delete
public void delete(int startIndex, int endIndex)- Specified by:
- deletein interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
cut
public void cut(int startIndex, int endIndex)- Specified by:
- cutin interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
paste
public void paste(int startIndex)- Specified by:
- pastein interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
replaceText
public void replaceText(int startIndex, int endIndex, String s)- Specified by:
- replaceTextin interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
- s- the string to replace the text between two indices
selectText
public void selectText(int startIndex, int endIndex)- Specified by:
- selectTextin interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
setAttributes
public void setAttributes(int startIndex, int endIndex, AttributeSet as)- Specified by:
- setAttributesin interface- AccessibleEditableText
- Parameters:
- startIndex- the starting index in the text
- endIndex- the ending index in the text
- as- the attribute set
- See Also:
© 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/JSpinner.AccessibleJSpinner.html