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

Arabic characters are not displayed correctly

    XMLWordPrintable

Details

    • 1.2.1
    • x86
    • windows_95, windows_nt
    • Verified

    Description



      Name: mf23781 Date: 10/06/98


      *Symptoms:

      In arabic locale

      Using any of the JTextComponent, try to type arabic
      by pressing Alt+rightshift. Arabic characters are displayed
      isolated, they should be connected. This was functionning
      correctly until JDK1.2PreFCS_F.

      This problem appears if using any of the swing component
      to Display arabic data.



      ======================================================================

      Name: krT82822 Date: 07/04/99


      These trials are tested on both appletviewer (platform 1.2) and Arabic Internet explorer (3.02) plug-in enabled, and application the output is the same for all.
      ? When typing into the JTextField with languages toggled into Arabic, the Arabic characters appears but not the typed one and some times rubbish.


      ? Trying swing (JFC in javax.swing) components for showing Arabic characters (JTable, JList, JComboBox, JTextArea and JTree).
      Output: the Arabic characters do not appear correctly, just rubbish (different appearance for each component).

      ? Trying to use ListCellRenderer:
      We made a class implementing ListCellRenderer, containing JTextField as a member variable, overwrote getListCellRendererComponent function and set the text of the JTextField in it, setCellRenderer for the Jlist with this class
      Output: We got the same output as before.
      ? Trying to extend a class from Label implementing ListCellRenderer:
      //here is the code
      class MyListCellRenderer extends Label implements ListCellRenderer
      {
      public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus)
      {
      String s = value.toString();
      setText(s);
      return this;
      }
      }

      Then used setCellRenderer function for the list with an object of our class.
      Output: The Arabic characters appear correctly, but it flickers (Painting problem this happens when using any AWT component in the renders classes in general if using JFC component no flickering but rubbish).
      ? Implementing a class inherited from DefaultCellEditor:
      //code
      class MyCellEditor extends DefaultCellEditor
          {
      TextField text;
      MyCellEditor (JTextField text1)
      {
      super(text1);
      text=new TextField(30);
      }
      public Component getComponent()
      {
      return text;
      }
      public Component getTableCellEditorComponent(JTable table,Object value,boolean isSelected,int row,int column)
      {
      return text;
      }
      }

      And in the main function:
      JTable dataTable = new JTable(2,2);
      JTextField T=new JTextField; dataTable.getColumnModel().getColumn(1).setCellEditor(new MyCellEditor(T));
      Using the JTextField as a dummy object for the constructor.
      Output: The arabic characters are being typed correctly, but when displaying rubbish appears.
      ? Implementing a class inherited from DefaultCellRender:
      //Code
      class MyCellRender extends DefaultTableCellRenderer
          {
      Label text;
      MyCellRender()
      {
      text=new Label();
      }
         


      public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column)
      {
      String s = value.toString();
      text.setText(s);
      return text;
      }
      }
       
      And in the main function:
      JTable dataTable = new JTable(2,2);
      MyCellRender myRender =new MyCellRender();
      dataTable.getColumnModel().getColumn(1).setCellRenderer(myRender);

      Output: The Arabic characters appear correctly, but it flickers(using AWT component?).

      All the above trials happened also in Jtree,JcomboBox,Jlist
      N.B
      The Code was compiled and run on the 1.2 platform using javax.swing
      (Review ID: 53857)
      ======================================================================

      Attachments

        Activity

          People

            bcbeck Brian Beck (Inactive)
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: