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

Font functionality is broken for JTable cells in editing mode

    XMLWordPrintable

Details

    Description



      Name: jbT81659 Date: 11/03/2000

      JDK: Kestrel, Merlin
      OS: All tested platforms

      Bidi text JTable cells is displayed correctly upon initilization of JTable.
      Clicking a JTable cell twice for editing causes the RTL text to be displayed as boxes.
      Moving the focus on another location in JTable or another JTable cell causes
      the RTL text in the previously opened cell to be displayed correctly again.

      To reproduce bug:
      1- Compile and run the following code.
      2- Note that bidi characters are displayed correctly( not boxes).
      3- Use the mouse to double click a JTable cell.
      4- Not that all RTL characters are displayed as boxes now.
      5- Try to insert RTL chars (If avilable)
      6- Note that input chars are also displayed as boxes.
      7- Click somewhere else with the mouse (inside JTable).
      8- Note that text in the cell that was displayed as boxes
       is now displayed correctly.

      -----------Code-----------------
      /* Copyright (c) Sun Microsystems 1998

      $Header: /home/sun/src/JDK1.2/jTable.java,v 1.11 2000/03/30 08:13:08 isam Exp $

      */

      import java.awt.*;
      import javax.swing.*;
      import java.awt.event.*;

      public class jTable extends JApplet
      {
              public void init()
              {
                      SimpleTable st = new SimpleTable();
                      getContentPane().add(st);
              }


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

              }
      }


      class SimpleTable extends JPanel
      {

              public SimpleTable()
              {

                      JTable jt = new JTable(new String[][]
                      {
                      {"\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4",
                      "\u0647\u0630\u0627\u0020\u064a\u0648\u0645\u0020\u0644\u0637\u064a\u0641\u0020\u05d6\u05d4\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd",
                      "\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631\u0020\u0042\u0049\u0047\u0020\u0052\u0045\u0044\u0020\u0041\u0050\u0050\u004c\u0045\u0053",
                      "\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u05d9\u05e7\u05e8"},
                      {"\u006c\u0069\u006d\u0065\u0020\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u05d9\u05e7\u05e8\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e",
                      "\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u0020\u05d9\u05e7\u05e8","\u006c\u0069\u006d\u0065\u0020\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u05d9\u05e7\u05e8\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e"},
                      {"\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4\u0020\u0054\u0048\u0045\u0020\u0059\u0045\u0041\u0052\u0020\u0031\u0039\u0035\u0038",
                     "\u05d7\u05d5\u05de\u05d5\u05e1\u0020\u006c\u0069\u006d\u0065\u0020\u0069\u0073\u0020\u0067\u0072\u0065\u0065\u006e\u0020\u05d9\u05e7\u05e8" ,"\u05d6\u05d5\u0020\u05e9\u05e0\u05d4\u0020\u05d9\u05e4\u05d4\u0020\u0054\u0048\u0045\u0020\u0059\u0045\u0041\u0052\u0020\u0031\u0039\u0035\u0038"}},
                     new String[] {"\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u0643\u0628\u064a\u0631\u0020\u0042\u0049\u0047\u0020\u0052\u0045\u0044\u0020\u0041\u0050\u0050\u004c\u0045\u0053",
                     "\u0647\u0630\u0627\u0020\u064a\u0648\u0645\u0020\u0644\u0637\u064a\u0641\u0020\u05d6\u05d4\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd"});
          JScrollPane jsp = new JScrollPane(jt);
          jt.setFont(new Font("Lucida Sans Regular",Font.PLAIN,15));
          add(jsp, BorderLayout.CENTER);

              }
      }
      --------------------------------
      6-


      WorkAround:
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              bcbeck Brian Beck (Inactive)
              jbenavrasunw Jonathan Benavraham (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: