Example usage for java.awt Component getAccessibleContext

List of usage examples for java.awt Component getAccessibleContext

Introduction

In this page you can find the example usage for java.awt Component getAccessibleContext.

Prototype

public AccessibleContext getAccessibleContext() 

Source Link

Document

Gets the AccessibleContext associated with this Component .

Usage

From source file:Main.java

/**
 * Recursively changes the background of a component and all its children.
 * @param c - The Root Component//from w w w.  j ava  2s. c  o m
 * @param bg - The Background Colour
 */
public static void setBackground(Component c, Color bg) {
    setBackground0(c.getAccessibleContext(), bg);
}

From source file:Main.java

/**
 * Recursively changes the foreground of a component and all its children.
 *
 * @param c - The Root Component// ww w.  ja  v a 2 s .c  om
 * @param fg - The Foreground Colour
 */
public static void setForeground(Component c, Color fg) {
    setForeground0(c.getAccessibleContext(), fg);
}