-
- All Implemented Interfaces:
- Serializable, AccessibleComponent, AccessibleExtendedComponent, AccessibleText
- Enclosing class:
- JLabel
protected class JLabel.AccessibleJLabel extends JComponent.AccessibleJComponent implements AccessibleText, AccessibleExtendedComponent
The class used to obtain the accessible role for this object.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the
java.beanspackage. Please seeXMLEncoder.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JComponent.AccessibleJComponent
JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler
-
Nested classes/interfaces inherited from class java.awt.Component.AccessibleAWTComponent
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent.AccessibleJComponent
accessibleFocusHandler
-
Fields inherited from class java.awt.Container.AccessibleAWTContainer
accessibleContainerHandler
-
Fields inherited from class java.awt.Component.AccessibleAWTComponent
accessibleAWTComponentHandler, accessibleAWTFocusHandler
-
Fields inherited from 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
-
-
Constructor Summary
Constructors Modifier Constructor and Description protectedJLabel.AccessibleJLabel()
-
Method Summary
Methods Modifier and Type Method and Description AccessibleIcon[]getAccessibleIcon()Get the AccessibleIcons associated with this object if one or more exist.AccessibleKeyBindinggetAccessibleKeyBinding()Returns key bindings associated with this objectStringgetAccessibleName()Get the accessible name of this object.AccessibleRelationSetgetAccessibleRelationSet()Get the AccessibleRelationSet associated with this object if one exists.AccessibleRolegetAccessibleRole()Get the role of this object.AccessibleTextgetAccessibleText()Gets the AccessibleText associated with this object presenting text on the display.StringgetAfterIndex(int part, int index)Returns the String after a given index.StringgetAtIndex(int part, int index)Returns the String at a given index.StringgetBeforeIndex(int part, int index)Returns the String before a given index.intgetCaretPosition()Return the zero-based offset of the caret.AttributeSetgetCharacterAttribute(int i)Return the AttributeSet for a given character at a given indexRectanglegetCharacterBounds(int i)Determine the bounding box of the character at the given index into the string.intgetCharCount()Return the number of characters (valid indicies)intgetIndexAtPoint(Point p)Given a point in local coordinates, return the zero-based index of the character under that Point.StringgetSelectedText()Returns the portion of the text that is selected.intgetSelectionEnd()Returns the end offset within the selected text.intgetSelectionStart()Returns the start offset within the selected text.StringgetTitledBorderText()Returns the titled border textStringgetToolTipText()Returns the tool tip text-
Methods inherited from class javax.swing.JComponent.AccessibleJComponent
addPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleStateSet, getBorderTitle, removePropertyChangeListener
-
Methods inherited from class java.awt.Container.AccessibleAWTContainer
getAccessibleAt
-
Methods inherited from 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 inherited from class javax.accessibility.AccessibleContext
firePropertyChange, getAccessibleAction, getAccessibleEditableText, getAccessibleSelection, getAccessibleTable, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from 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
-
-
-
-
Method Detail
-
getAccessibleName
public String getAccessibleName()
Get the accessible name of this object.- Overrides:
getAccessibleNamein classJComponent.AccessibleJComponent- Returns:
- the localized name of the object -- can be null if this object does not have a name
- See Also:
AccessibleContext.setAccessibleName(java.lang.String)
-
getAccessibleRole
public AccessibleRole getAccessibleRole()
Get the role of this object.- Overrides:
getAccessibleRolein classJComponent.AccessibleJComponent- Returns:
- an instance of AccessibleRole describing the role of the object
- See Also:
AccessibleRole
-
getAccessibleIcon
public AccessibleIcon[] getAccessibleIcon()
Get the AccessibleIcons associated with this object if one or more exist. Otherwise return null.- Overrides:
getAccessibleIconin classAccessibleContext- Returns:
- an array of AccessibleIcon if supported by object; otherwise return null
- Since:
- 1.3
- See Also:
AccessibleIcon
-
getAccessibleRelationSet
public AccessibleRelationSet getAccessibleRelationSet()
Get the AccessibleRelationSet associated with this object if one exists. Otherwise return null.- Overrides:
getAccessibleRelationSetin classAccessibleContext- Returns:
- an AccessibleRelationSet if supported by object; otherwise return null
- Since:
- 1.3
- See Also:
AccessibleRelation
-
getAccessibleText
public AccessibleText getAccessibleText()
Description copied from class:AccessibleContextGets the AccessibleText associated with this object presenting text on the display.- Overrides:
getAccessibleTextin classAccessibleContext- Returns:
- AccessibleText if supported by object; else return null
- See Also:
AccessibleText
-
getIndexAtPoint
public int getIndexAtPoint(Point p)
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.- Specified by:
getIndexAtPointin interfaceAccessibleText- Parameters:
p- the Point in local coordinates- Returns:
- the zero-based index of the character under Point p; if Point is invalid returns -1.
- Since:
- 1.3
-
getCharacterBounds
public Rectangle getCharacterBounds(int i)
Determine 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.- Specified by:
getCharacterBoundsin interfaceAccessibleText- Parameters:
i- the index into the String- Returns:
- the screen coordinates of the character's the bounding box, if index is invalid returns an empty rectangle.
- Since:
- 1.3
-
getCharCount
public int getCharCount()
Return the number of characters (valid indicies)- Specified by:
getCharCountin interfaceAccessibleText- Returns:
- the number of characters
- Since:
- 1.3
-
getCaretPosition
public int getCaretPosition()
Return 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).- Specified by:
getCaretPositionin interfaceAccessibleText- Returns:
- the zero-based offset of the caret.
- Since:
- 1.3
-
getAtIndex
public String getAtIndex(int part, int index)
Returns the String at a given index.- Specified by:
getAtIndexin interfaceAccessibleText- Parameters:
part- the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieveindex- an index within the text >= 0- Returns:
- the letter, word, or sentence, null for an invalid index or part
- Since:
- 1.3
-
getAfterIndex
public String getAfterIndex(int part, int index)
Returns the String after a given index.- Specified by:
getAfterIndexin interfaceAccessibleText- Parameters:
part- the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieveindex- an index within the text >= 0- Returns:
- the letter, word, or sentence, null for an invalid index or part
- Since:
- 1.3
-
getBeforeIndex
public String getBeforeIndex(int part, int index)
Returns the String before a given index.- Specified by:
getBeforeIndexin interfaceAccessibleText- Parameters:
part- the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieveindex- an index within the text >= 0- Returns:
- the letter, word, or sentence, null for an invalid index or part
- Since:
- 1.3
-
getCharacterAttribute
public AttributeSet getCharacterAttribute(int i)
Return the AttributeSet for a given character at a given index- Specified by:
getCharacterAttributein interfaceAccessibleText- Parameters:
i- the zero-based index into the text- Returns:
- the AttributeSet of the character
- Since:
- 1.3
-
getSelectionStart
public int 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.- Specified by:
getSelectionStartin interfaceAccessibleText- Returns:
- the index into the text of the start of the selection
- Since:
- 1.3
-
getSelectionEnd
public int 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.- Specified by:
getSelectionEndin interfaceAccessibleText- Returns:
- the index into teh text of the end of the selection
- Since:
- 1.3
-
getSelectedText
public String getSelectedText()
Returns the portion of the text that is selected.- Specified by:
getSelectedTextin interfaceAccessibleText- Returns:
- the String portion of the text that is selected
- Since:
- 1.3
-
getToolTipText
public String getToolTipText()
Returns the tool tip text- Specified by:
getToolTipTextin interfaceAccessibleExtendedComponent- Overrides:
getToolTipTextin classJComponent.AccessibleJComponent- Returns:
- the tool tip text, if supported, of the object; otherwise, null
- Since:
- 1.4
-
getTitledBorderText
public String getTitledBorderText()
Returns the titled border text- Specified by:
getTitledBorderTextin interfaceAccessibleExtendedComponent- Overrides:
getTitledBorderTextin classJComponent.AccessibleJComponent- Returns:
- the titled border text, if supported, of the object; otherwise, null
- Since:
- 1.4
-
getAccessibleKeyBinding
public AccessibleKeyBinding getAccessibleKeyBinding()
Returns key bindings associated with this object- Specified by:
getAccessibleKeyBindingin interfaceAccessibleExtendedComponent- Overrides:
getAccessibleKeyBindingin classJComponent.AccessibleJComponent- Returns:
- the key bindings, if supported, of the object; otherwise, null
- Since:
- 1.4
- See Also:
AccessibleKeyBinding
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
10/10/2025 03:53:04 Cette version de la page est en cache (à la date du 10/10/2025 03:53:04) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 31/08/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/swing/JLabel.AccessibleJLabel.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.