Example usage for javax.accessibility AccessibleComponent setCursor

List of usage examples for javax.accessibility AccessibleComponent setCursor

Introduction

In this page you can find the example usage for javax.accessibility AccessibleComponent setCursor.

Prototype

public void setCursor(Cursor cursor);

Source Link

Document

Sets the cursor of this object.

Usage

From source file:MainClass.java

void dumpComponentInfo(AccessibleContext ac) {
    AccessibleComponent ax = ac.getAccessibleComponent();

    if (ax != null) {
        String s = ac.getAccessibleName();

        if (s != null && s.equals("OK")) {
            System.out.println("Background color: " + ax.getBackground());
            System.out.println("Cursor: " + ax.getCursor());
            Cursor c = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
            ax.setCursor(c);
            System.out.println("Foreground color: " + ax.getForeground());
            System.out.println("Location: " + ax.getLocationOnScreen());
        }/* w  w  w.  j  ava  2  s .c o  m*/
    }

    int nChildren = ac.getAccessibleChildrenCount();

    for (int i = 0; i < nChildren; i++)
        dumpComponentInfo(ac.getAccessibleChild(i).getAccessibleContext());
}