Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5014911

b32c, b40, b42 input Arabic and Hebrew charaters fail in JTextComponents


    • Subcomponent:
    • Resolved In Build:
    • CPU:
    • OS:
      linux, linux_redhat_9.0


      Locale: ar_SA, he_IL, en_US
      Regression: Yes
      Build: b32c, b40, b42
      Inputing Arabic and Hebrew (RTL) characters in JTextField, JTextArea and JTextPane fails. Input characters are not displayed in the JTextComponent. Only latin characters and numbers can be input in the JTextComponents. This bug occurs only under Redhat9.

      To reproduce bug
      1. Log into a Redhat9 machine
      2. choose KDE windows manager
      3. Verify you have Arabic and Hebrew keyboard mapping, so you can type Arabic and hebrew characters
      4. Compile and run the following testcase "jTextComponent.java"
      5. In the JtextField, type some English characters
      6. Verify that English characters are input and displayed in the JTextField
      7. Switch Language to Arabic
      8. Type some Arabic characters
      9. Note that Arabic characters are not displayed in the JTextField
      10. Repeat above steps for the JTextArea and JTextpane
      11. Switch Language to Hebrew
      12. Type some Hebrew characters
      13. Note that Hebrew characters are not displayed in the JTextComponents

      /* Copyright (c) Sun Microsystems 1999

      $Header: /home-bazelet/sun/src/javaLab/JDK1.4/standard/jTextComponent.java,v 2001/06/19 15:01:31 isam Exp $


      import java.awt.*;
      import java.awt.font.*;
      import java.awt.event.*;
      import javax.swing.*;
      import javax.swing.border.*;
      import javax.swing.text.*;

      public class jTextComponent extends JApplet
        public void init()
          jTextComponent1 jTextComponent2 = new jTextComponent1();

        public static void main(String[] args)
          JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
          frame.setContentPane(new jTextComponent1());
              frame.addWindowListener( new WindowAdapter()
                   public void windowClosing( WindowEvent e)

      class jTextComponent1 extends JPanel
        public jTextComponent1()
          JLabel l;
          JPanel p;
          JTextField field;
          JTextArea area;
          JTextPane pane;
          JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));

          p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
          l = new JLabel("JTF1, implicit, left");
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          field = new JTextField(15);
          field.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          p.setPreferredSize(new Dimension(175,60));

          p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
          l = new JLabel("JTA2, explicit RTL, left");
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          area = new JTextArea();
          area.setPreferredSize(new Dimension(180,250));
          p.setPreferredSize(new Dimension(175,110));

          p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
          l = new JLabel("JTP1 implicit, left");
          pane = new JTextPane();
          pane.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          pane.setPreferredSize(new Dimension(180,250));
          p.setPreferredSize(new Dimension(175,160));

          panel.setPreferredSize(new Dimension(300,1900));

          JScrollPane scroll = new JScrollPane(panel);
          scroll.setPreferredSize(new Dimension(210,450));



          Issue Links



              • Assignee:
                yan Yuri Nesterenko
                jbenavrasunw Jonathan Benavraham (Inactive)
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: