ComponentOrientation: isHorizontal() : ComponentOrientation « java.awt « Java by API






ComponentOrientation: isHorizontal()

 
 
import java.awt.ComponentOrientation;
import java.util.Locale;

public class Main {

  public static void main(String[] argv) throws Exception {

    Locale myLocale;
    if (argv.length < 2)
      myLocale = Locale.getDefault();
    else
      myLocale = new Locale(argv[0], argv[1]);
    ComponentOrientation ce = ComponentOrientation.getOrientation(myLocale);
    System.out.println("Is horizontal? " + ce.isHorizontal());
    System.out.println("Is left to right? " + ce.isLeftToRight());
  }
}

   
  








Related examples in the same category

1.ComponentOrientation.RIGHT_TO_LEFT
2.ComponentOrientation: getOrientation(Locale locale)
3.ComponentOrientation: isLeftToRight()