List of usage examples for javax.accessibility AccessibleText getCaretPosition
public int getCaretPosition();
From source file:MainClass.java
void dumpTextInfo(AccessibleContext ac) { AccessibleText at = ac.getAccessibleText(); if (at != null) { System.out.println("Caret position = " + at.getCaretPosition()); System.out.println("Selected text = " + at.getSelectedText()); return;/* w w w. ja v a 2 s. c om*/ } int nChildren = ac.getAccessibleChildrenCount(); for (int i = 0; i < nChildren; i++) dumpTextInfo(ac.getAccessibleChild(i).getAccessibleContext()); }