Example usage for java.awt Component applyComponentOrientation

List of usage examples for java.awt Component applyComponentOrientation

Introduction

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

Prototype

public void applyComponentOrientation(ComponentOrientation orientation) 

Source Link

Document

Sets the ComponentOrientation property of this component and all components contained within it.

Usage

From source file:Main.java

/**
 * Copies component orientation from one component to another.
 *
 * @param from/*from w  w  w  .j  a  v a  2s. c o  m*/
 *            component to copy orientation from
 * @param to
 *            component to copy orientation into
 */
public static void copyOrientation(final Component from, final Component to) {
    final ComponentOrientation fo = from.getComponentOrientation();
    if (fo.isLeftToRight() != to.getComponentOrientation().isLeftToRight()) {
        to.applyComponentOrientation(fo);
    }
}