Duplicate :
|
Name: pa48320 Date: 01/29/2002 JTextField doesn't draw BiDi text correctly in the following cases. Cursor movement is also incorrect (loops within a part of the strings). format: {logical order} -> [visual order] [(expected results)] (each capital alphabet represents an Arabic letter) [Left to Right] ABC 10 -> 10CBA (10 CBA) ABC 10 20 -> *1 (20 10 CBA) ABC 10 abc -> 10CBA abc (10 CBA abc) ABC 10abc -> 10CAB abc (10 CBAabc) 10 ABC 20 -> 10 20CBA (10 20 CBA) ABC 10 DEF -> FED 10CBA (FED 10 CBA) [Right to Left] -3ABC -> CBA-3 (-3ABC) *1: JTextField freezes To reproduce: simply run the following applet and enter the above strings. ########## code ########## import java.awt.*; import java.awt.event.*; import javax.swing.*; public class swingTest extends JApplet { private JTextField jtf1; private JTextField jtf2; public void init() { jtf1 = new JTextField(30); jtf2 = new JTextField(30); jtf1.setFont(new Font("dialog", 0, 12)); jtf2.setFont(new Font("dialog", 0, 12)); jtf1.setBounds(new Rectangle(30, 30, 300, 30)); jtf2.setBounds(new Rectangle(400, 30, 300, 30)); jtf1.setText(""); jtf2.setText(""); jtf1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); jtf2.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); Container c = getContentPane(); c.setLayout(new FlowLayout()); c.add(jtf1); c.add(jtf2); } } (Review ID: 138911) ====================================================================== ###@###.### 2002-01-29 the customer writes: I made a mistake when I do copy and paste. Could you or someone please correct the below? Wrong: > [Right to Left] > -3ABC -> CBA-3 (-3ABC) Correct: > [Right to Left] > -3ABC -> CBA-3 (CBA3-) ~~~~~