Convenience function for determining Component Orientation. - Java Swing

Java examples for Swing:JComponent

Description

Convenience function for determining Component Orientation.

Demo Code

/**   Utility class for the Tonic look and feel.
 * /* w w w  .  j a v a2 s  .c  om*/
 *    @author Markus Fischer
 *
 *     <p>This software is under the <a href="http://www.gnu.org/copyleft/lesser.html" target="_blank">GNU Lesser General Public License</a>
 */
//package com.java2s;
import java.awt.*;

public class Main {
    /**   Convenience function for determining ComponentOrientation.  Helps us
     *    avoid having Munge directives throughout the code.
     */
    static boolean isLeftToRight(Component c) {
        return c.getComponentOrientation().isLeftToRight();
    }
}

Related Tutorials