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

Graphics2D can not draw Tranditional Chinese string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • client-libs
    • 2d
    • x86
    • windows_95



      Name: rm29839 Date: 01/05/98


      Run the following program. The str is a string which contains two
      Tranditional Chinese characters. The Graphics2D object display this
      string as ",f" but the Graphics object display it correctly.

      -

      import java.awt.*;
      import java.awt.event.*;

      public class Test extends Panel {
        public static void main(String argv[]) {
          Frame frame = new Frame();
          frame.add(new Test());
          frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}}
          );
          frame.setSize(500, 500);
          frame.show();
        }

        String str = "\u6e2c\u8a66";

        public void paint(Graphics g)
        {
          Graphics2D g2d = (Graphics2D) g;
          g2d.drawString(str, 50.0f, 100.0f);
          g.drawString(str, 50, 150);
        }
      }
      (Review ID: 22312)
      ======================================================================

            jkaulorcl Jeet Kaul (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: