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

The caret is displayed on the character after the bold Japanese text.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.1
    • client-libs



      Name: jk109818 Date: 04/01/2003


      FULL PRODUCT VERSION :
      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

      java version "1.4.1_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
      Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)


      FULL OS VERSION :
      Microsoft Windows 2000 [Version 5.00.2195] Japanese Service Pack 3
      SunOS 5.8 Generic_108528-01 sun4u sparc SUNW,Ultra-5_10 with Japanse locale
      RedHatLinux 7.2 with KDE and Japanese locale


      A DESCRIPTION OF THE PROBLEM :
      The caret mark is displayed on the character instead of
      between the characters on the text components (for instance
      JTextField) when the caret position stays after the
      bold Japanese text in a line.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run the following program
      2. See the caret position in the text component
      //exp: the caret is displayed end of the text as well as after the plane text.
      //act: the caret is displayed on the middle of the last character.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      The caret is displayed end of the text as well as after the plane Japanese text.
      The caret is displayed on the middle of the last character instead of the end of last character.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package boldfonttest;

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

      public class Frame1 extends JFrame {
        JTextField jTextField1 = new JTextField();
        JTextField jTextField2 = new JTextField();
        String testText ="\u3042\u3042\u3042\u3042\u3042\u3044\u3044\u3044\u3044\u3044\u3046\u3046\u3046\u3046\u3046\u3048\u3048\u3048\u3048\u3048\u304A\u304A\u304A\u304A\u304A";
        public Frame1() {
          try {
            jbInit();
            jTextField1.setText(testText+"Bold");
            jTextField2.setText(testText+"Plain");
            jTextField1.select(jTextField1.getText().length(),jTextField1.getText().length());
          }
          catch(Exception e) {
            e.printStackTrace();
          }
        }
        public static void main(String[] args) {
          Frame1 frame1 = new Frame1();
          frame1.setSize(800,300);
          frame1.setVisible(true);
        }
        private void jbInit() throws Exception {
          jTextField1.setFont(new java.awt.Font("Dialog", Font.BOLD, 24));
          jTextField1.setText("jTextField1");
          this.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(WindowEvent e) {
              this_windowClosing(e);
            }
          });
          jTextField2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 24));
          jTextField2.setText("jTextField1");
          this.getContentPane().add(jTextField1, BorderLayout.NORTH);
          this.getContentPane().add(jTextField2, BorderLayout.CENTER);
        }

        void this_windowClosing(WindowEvent e) {
          System.exit(0);
        }
      }


      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use the plane Japanese font.
      (Review ID: 183295)
      ======================================================================

            naasunw Naa Naa (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: