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