Example usage for javax.accessibility AccessibleRelation getTarget

List of usage examples for javax.accessibility AccessibleRelation getTarget

Introduction

In this page you can find the example usage for javax.accessibility AccessibleRelation getTarget.

Prototype

public Object[] getTarget() 

Source Link

Document

Returns the target objects for this relation.

Usage

From source file:MainClass.java

void dumpConnectedInfo(AccessibleContext ac) {
    AccessibleRelationSet ars = ac.getAccessibleRelationSet();

    AccessibleRelation ar = null;

    if (ars != null)
        ar = ars.get("connector");

    if (ar != null) {
        Object[] o = ar.getTarget();
        JComponent jc = (JComponent) o[0];
        System.out.println("Label connected to: " + jc.getAccessibleContext().getAccessibleName());
        return;/*from  w ww .  jav a2s .  com*/
    }
    int nChildren = ac.getAccessibleChildrenCount();
    for (int i = 0; i < nChildren; i++)
        dumpConnectedInfo(ac.getAccessibleChild(i).getAccessibleContext());
}