Java examples for Swing:FlowLayout
This way, you do not need to set the orientation for every container in your application.
import java.awt.ComponentOrientation; import java.util.Locale; import javax.swing.JComponent; import javax.swing.JFrame; public class Main { public static void main(String[] argv) throws Exception { // Get the default locale Locale defaultLocale = JComponent.getDefaultLocale(); // Get the component's orientation for the default locale ComponentOrientation componentOrientation = ComponentOrientation .getOrientation(defaultLocale);/* w ww . ja v a 2 s . c o m*/ JFrame frame = new JFrame(); // Apply the component's default orientation for the whole frame frame.applyComponentOrientation(componentOrientation); } }