import java.awt.BorderLayout; import java.awt.ComponentOrientation; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JTextField; public class TestComponentOrientation extends JFrame { private static final long serialVersionUID = 1L; private static TestComponentOrientation t; private JTextField f1 = new JTextField(15); public TestComponentOrientation() { super("test"); f1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); f1.setHorizontalAlignment(JTextField.RIGHT); f1.setFont(new Font("Lucida Sans",Font.PLAIN,20)); String s = new String(new char[]{1488,1489,1490}); char[] cs = new char[3]; s += " "; s += "aaaaabbbbbcccccdddddeee"; setDefaultCloseOperation(EXIT_ON_CLOSE); getContentPane().setLayout(new BorderLayout()); getContentPane().add(f1,BorderLayout.CENTER); f1.setText(s); pack(); setVisible(true); f1.setCaretPosition(0); } public static void main(String[] args) throws InterruptedException { t = new TestComponentOrientation(); } }