Java JFrame set component orientation

Description

Java JFrame set component orientation

import java.awt.ComponentOrientation;

import javax.swing.JFrame;

public class Main {
   public static void main(String[] args) {
      JFrame.setDefaultLookAndFeelDecorated(true);
      JFrame frame = new JFrame("Right to Left Frame");

      frame.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);

      frame.setSize(300, 300);/*from  ww  w  .  j a v  a2s .  com*/
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
   }
}



PreviousNext

Related