JDK-4101746 : Graphics2D can not draw Tranditional Chinese string
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1998-01-05
  • Updated: 1998-01-28
  • Resolved: 1998-01-28
Related Reports
Duplicate :  
Description

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)
======================================================================