public interface AccessibleText 
       AccessibleText界面应由显示文本信息的所有类实现。 该界面提供了辅助技术通过其内容,属性和空间位置访问该文本的标准机制。 应用程序可以通过首先获取AccessibleContext(参见Accessible ),然后调用AccessibleContext的AccessibleContext.getAccessibleText()方法来确定对象是否支持AccessibleText接口。 如果返回值不为空,则该对象支持该接口。 
| Modifier and Type | Field and Description | 
|---|---|
| static int | CHARACTER
              常数用于表示应检索的文本部分是一个字符。 
             | 
| static int | SENTENCE
              常数用于表示应检索的部分文本是一个句子。 
             | 
| static int | WORD
              常数用于表示应检索的文本部分是一个单词。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getAfterIndex(int part, int index)
              返回给定索引后的String。 
             | 
| String | getAtIndex(int part, int index)
              返回给定索引处的String。 
             | 
| String | getBeforeIndex(int part, int index)
              返回给定索引之前的String。 
             | 
| int | getCaretPosition()
              返回插入符号的从零开始的偏移量。 
             | 
| AttributeSet | getCharacterAttribute(int i)
              返回给定索引处给定字符的AttributeSet 
             | 
| Rectangle | getCharacterBounds(int i)
              将给定索引处的字符的边框确定为字符串。 
             | 
| int | getCharCount()
              返回字符数(有效指标) 
             | 
| int | getIndexAtPoint(Point p)
              给定本地坐标点,返回该点下的字符从零开始的索引。 
             | 
| String | getSelectedText()
              返回所选文本的部分。 
             | 
| int | getSelectionEnd()
              返回所选文本中的结束偏移量。 
             | 
| int | getSelectionStart()
              返回所选文本中的起始偏移量。 
             | 
static final int CHARACTER
static final int WORD
static final int SENTENCE
int getIndexAtPoint(Point p)
p - 本地坐标点 
           Rectangle getCharacterBounds(int i)
i - 索引到String中 
           int getCharCount()
int getCaretPosition()
String getAtIndex(int part, int index)
part - 要检索的CHARACTER,WORD或SENTENCE 
           index - 文本中的索引 
           String getAfterIndex(int part, int index)
part - 要检索的CHARACTER,WORD或SENTENCE 
           index - 文本中的索引 
           String getBeforeIndex(int part, int index)
part - 要检索的CHARACTER,WORD或SENTENCE 
           index - 文本中的索引 
           AttributeSet getCharacterAttribute(int i)
i - 从零开始的文字索引 
           int getSelectionStart()
int getSelectionEnd()
String getSelectedText()
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.