Example usage for javax.accessibility AccessibleRelationSet get

List of usage examples for javax.accessibility AccessibleRelationSet get

Introduction

In this page you can find the example usage for javax.accessibility AccessibleRelationSet get.

Prototype

public AccessibleRelation get(String key) 

Source Link

Document

Returns the relation that matches the specified key.

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;// w ww. ja v a  2  s . co m
    }
    int nChildren = ac.getAccessibleChildrenCount();
    for (int i = 0; i < nChildren; i++)
        dumpConnectedInfo(ac.getAccessibleChild(i).getAccessibleContext());
}