protected class

JLabel.AccessibleJLabel

extends JComponent.AccessibleJComponent
implements AccessibleExtendedComponent AccessibleText
java.lang.Object
   ↳ javax.accessibility.AccessibleContext
     ↳ java.awt.Component.AccessibleAWTComponent
       ↳ java.awt.Container.AccessibleAWTContainer
         ↳ javax.swing.JComponent.AccessibleJComponent
           ↳ javax.swing.JLabel.AccessibleJLabel

Class Overview

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.beans package. Please see XMLEncoder.

Summary

[Expand]
Inherited Constants
From class javax.accessibility.AccessibleContext
From interface javax.accessibility.AccessibleText
[Expand]
Inherited Fields
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
Protected Constructors
JLabel.AccessibleJLabel()
Public Methods
AccessibleIcon[] getAccessibleIcon()
Get the AccessibleIcons associated with this object if one or more exist.
AccessibleKeyBinding getAccessibleKeyBinding()
Returns key bindings associated with this object
String getAccessibleName()
Get the accessible name of this object.
AccessibleRelationSet getAccessibleRelationSet()
Get the AccessibleRelationSet associated with this object if one exists.
AccessibleRole getAccessibleRole()
Get the role of this object.
AccessibleText getAccessibleText()
Gets the AccessibleText associated with this object presenting text on the display.
String getAfterIndex(int part, int index)
Returns the String after a given index.
String getAtIndex(int part, int index)
Returns the String at a given index.
String getBeforeIndex(int part, int index)
Returns the String before a given index.
int getCaretPosition()
Return the zero-based offset of the caret.
int getCharCount()
Return the number of characters (valid indicies)
AttributeSet getCharacterAttribute(int i)
Return the AttributeSet for a given character at a given index
Rectangle getCharacterBounds(int i)
Determine the bounding box of the character at the given index into the string.
int getIndexAtPoint(Point p)
Given a point in local coordinates, return the zero-based index of the character under that Point.
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 getTitledBorderText()
Returns the titled border text
String getToolTipText()
Returns the tool tip text
[Expand]
Inherited Methods
From class javax.swing.JComponent.AccessibleJComponent
From class java.awt.Container.AccessibleAWTContainer
From class java.awt.Component.AccessibleAWTComponent
From class javax.accessibility.AccessibleContext
From class java.lang.Object
From interface javax.accessibility.AccessibleComponent
From interface javax.accessibility.AccessibleExtendedComponent
From interface javax.accessibility.AccessibleText

Protected Constructors

protected JLabel.AccessibleJLabel ()

Public Methods

public AccessibleIcon[] getAccessibleIcon ()

Get the AccessibleIcons associated with this object if one or more exist. Otherwise return null.

Returns
  • an array of AccessibleIcon if supported by object; otherwise return null

public AccessibleKeyBinding getAccessibleKeyBinding ()

Returns key bindings associated with this object

Returns
  • the key bindings, if supported, of the object; otherwise, null

public String getAccessibleName ()

Get the accessible name of this object.

Returns
  • the localized name of the object -- can be null if this object does not have a name

public AccessibleRelationSet getAccessibleRelationSet ()

Get the AccessibleRelationSet associated with this object if one exists. Otherwise return null.

Returns
  • an AccessibleRelationSet if supported by object; otherwise return null

public AccessibleRole getAccessibleRole ()

Get the role of this object.

Returns
  • an instance of AccessibleRole describing the role of the object
See Also

public AccessibleText getAccessibleText ()

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

Returns
  • AccessibleText if supported by object; else return null

public String getAfterIndex (int part, int index)

Returns the String after a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

public String getAtIndex (int part, int index)

Returns the String at a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

public String getBeforeIndex (int part, int index)

Returns the String before a given index.

Parameters
part the AccessibleText.CHARACTER, AccessibleText.WORD, or AccessibleText.SENTENCE to retrieve
index an index within the text >= 0
Returns
  • the letter, word, or sentence, null for an invalid index or part

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).

Returns
  • the zero-based offset of the caret.

public int getCharCount ()

Return the number of characters (valid indicies)

Returns
  • the number of characters

public AttributeSet getCharacterAttribute (int i)

Return the AttributeSet for a given character at a given index

Parameters
i the zero-based index into the text
Returns
  • the AttributeSet of the character

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.

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.

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.

Parameters
p the Point in local coordinates
Returns
  • the zero-based index of the character under Point p; if Point is invalid returns -1.

public String getSelectedText ()

Returns the portion of the text that is selected.

Returns
  • the String portion of the text that is selected

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.

Returns
  • the index into teh text of the end of the selection

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.

Returns
  • the index into the text of the start of the selection

public String getTitledBorderText ()

Returns the titled border text

Returns
  • the titled border text, if supported, of the object; otherwise, null

public String getToolTipText ()

Returns the tool tip text

Returns
  • the tool tip text, if supported, of the object; otherwise, null