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

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

XMLWordPrintable

    • b40
    • x86
    • 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

      -------------jTextComponent.java------------------------
      /* Copyright (c) Sun Microsystems 1999

      $Header: /home-bazelet/sun/src/javaLab/JDK1.4/standard/jTextComponent.java,v 1.1.1.1 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();
          getContentPane().add(jTextComponent2);
        }

        public static void main(String[] args)
        {
          JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
          frame.setContentPane(new jTextComponent1());
          frame.pack();
          frame.setVisible(true);
              frame.addWindowListener( new WindowAdapter()
              {
                   public void windowClosing( WindowEvent e)
                   {
                       System.exit(0);
                   }
              });

        }
      }
      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.setVerticalAlignment(SwingConstants.BOTTOM);
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          field = new JTextField(15);
          field.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          field.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
          p.add(l);
          p.add(field);
          p.setPreferredSize(new Dimension(175,60));
          panel.add(p);


          p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
          l = new JLabel("JTA2, explicit RTL, left");
          l.setVerticalAlignment(SwingConstants.BOTTOM);
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          area = new JTextArea();
          area.setPreferredSize(new Dimension(180,250));
          area.setLineWrap(true);
          area.setText("\u0053\u0074\u0061\u0072\u0074\u0020\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
          p.add(l);
          p.add(area);
          p.setPreferredSize(new Dimension(175,110));
          panel.add(p);


          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.setVerticalAlignment(SwingConstants.BOTTOM);
          l.setFont(new Font("Lucida Sans Regular",Font.PLAIN,10));
          pane.setPreferredSize(new Dimension(180,250));
          pane.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
          p.add(l);
          p.add(pane);
          p.setPreferredSize(new Dimension(175,160));
          panel.add(p);


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

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

          add(scroll);
        }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: