Example usage for javax.swing JComponent getAccessibleContext

List of usage examples for javax.swing JComponent getAccessibleContext

Introduction

In this page you can find the example usage for javax.swing JComponent getAccessibleContext.

Prototype

public AccessibleContext getAccessibleContext() 

Source Link

Document

Gets the AccessibleContext associated with this Component .

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