javax.swing
protected class JLabel.AccessibleJLabel extends JComponent.AccessibleJComponent implements AccessibleText, AccessibleExtendedComponent
JLabel
component.JComponent.AccessibleJComponent.AccessibleContainerHandler, JComponent.AccessibleJComponent.AccessibleFocusHandler
Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
accessibleContainerHandler, accessibleFocusHandler
accessibleAWTComponentHandler, accessibleAWTFocusHandler
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
CHARACTER, SENTENCE, WORD
Modifier | Constructor and Description |
---|---|
protected |
JLabel.AccessibleJLabel() |
Modifier and Type | Method and Description |
---|---|
String |
getAccessibleName()
Returns the accessible name.
|
AccessibleRole |
getAccessibleRole()
Returns the accessible role for the
JLabel component. |
String |
getAfterIndex(int part,
int index)
Returns the character, word or sentence after the specified index.
|
String |
getAtIndex(int part,
int index)
Returns the character, word or sentence at the specified index.
|
String |
getBeforeIndex(int part,
int index)
Returns the character, word or sentence before the specified index.
|
int |
getCaretPosition()
Returns the caret position.
|
AttributeSet |
getCharacterAttribute(int index)
Returns an
AttributeSet that reflects the text attributes of
the specified character. |
Rectangle |
getCharacterBounds(int index)
Returns the bounding box of the character at the specified index.
|
int |
getCharCount()
Returns the number of characters that are displayed by the JLabel.
|
int |
getIndexAtPoint(Point point)
Returns the index of the character that is located at the specified
point.
|
String |
getSelectedText()
Returns the selected text.
|
int |
getSelectionEnd()
Returns the end index of the selected text.
|
int |
getSelectionStart()
Returns the start index of the selected text.
|
addPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getAccessibleDescription, getAccessibleKeyBinding, getAccessibleStateSet, getBorderTitle, getTitledBorderText, getToolTipText, removePropertyChangeListener
getAccessibleAt
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
firePropertyChange, getAccessibleAction, getAccessibleEditableText, getAccessibleIcon, getAccessibleRelationSet, getAccessibleSelection, getAccessibleTable, getAccessibleText, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccessibleKeyBinding, getTitledBorderText, getToolTipText
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
protected JLabel.AccessibleJLabel()
public String getAccessibleName()
getAccessibleName
in class JComponent.AccessibleJComponent
AccessibleContext.setAccessibleName(String)
public AccessibleRole getAccessibleRole()
JLabel
component.getAccessibleRole
in class JComponent.AccessibleJComponent
AccessibleRole.LABEL
.AccessibleRole
public String getSelectedText()
getSelectedText
in interface AccessibleText
null
because JLabels cannot have selected textpublic int getSelectionStart()
getSelectionStart
in interface AccessibleText
public int getSelectionEnd()
getSelectionEnd
in interface AccessibleText
public AttributeSet getCharacterAttribute(int index)
AttributeSet
that reflects the text attributes of
the specified character. We return an empty
AttributeSet
here, because JLabels don't support text
attributes (at least not yet).getCharacterAttribute
in interface AccessibleText
index
- the index of the characterAttributeSet
that reflects the text attributes of
the specified characterpublic String getAtIndex(int part, int index)
part
parameter determines what is returned, the character,
word or sentence after the index.getAtIndex
in interface AccessibleText
part
- one of AccessibleText.CHARACTER
,
AccessibleText.WORD
or
AccessibleText.SENTENCE
, specifying what is returnedindex
- the indexindex
public String getAfterIndex(int part, int index)
part
parameter determines what is returned, the character,
word or sentence after the index.getAfterIndex
in interface AccessibleText
part
- one of AccessibleText.CHARACTER
,
AccessibleText.WORD
or
AccessibleText.SENTENCE
, specifying what is returnedindex
- the indexindex
public String getBeforeIndex(int part, int index)
part
parameter determines what is returned, the character,
word or sentence before the index.getBeforeIndex
in interface AccessibleText
part
- one of AccessibleText.CHARACTER
,
AccessibleText.WORD
or
AccessibleText.SENTENCE
, specifying what is returnedindex
- the indexindex
public int getCaretPosition()
getCaretPosition
in interface AccessibleText
public int getCharCount()
getCharCount
in interface AccessibleText
public Rectangle getCharacterBounds(int index)
getCharacterBounds
in interface AccessibleText
index
- the index of the character that we return the
bounds forpublic int getIndexAtPoint(Point point)
getIndexAtPoint
in interface AccessibleText
point
- the location that we lookup the character for