Source Code : Internationalized Graphical User Interfaces: Component Orientation 1
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Internationalized Graphical User Interfaces: Component Orientation 1

import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
public class FlowLayoutDemo extends JFrame {
public FlowLayoutDemo() {
super("FlowLayoutDemo");
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
contentPane.add(new JButton("OK"));
contentPane.add(new JButton("Cancel"));
applyOrientation(this, ComponentOrientation.RIGHT_TO_LEFT);
}
public static void main(String[] argv) {
JFrame frame = new FlowLayoutDemo();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
private void applyOrientation(Component c, ComponentOrientation o) {
c.setComponentOrientation(o);
if (c instanceof JMenu) {
JMenu menu = (JMenu) c;
int ncomponents = menu.getMenuComponentCount();
for (int i = 0; i < ncomponents; ++i) {
applyOrientation(menu.getMenuComponent(i), o);
}
} else if (c instanceof Container) {
Container container = (Container) c;
int ncomponents = container.getComponentCount();
for (int i = 0; i < ncomponents; ++i) {
applyOrientation(container.getComponent(i), o);
}
}
}
}
Thank with us