Displaying Unicode in AWT components

Hi,

I have this problem on displaying chinese char on my awt button.

Not sure whether I'm doing it correctly but, when I run my applet (which contain the frame that contain the button), it will NOT be able to display it (Using Sun JVM).

But, if I'm using Microsoft JVM, it will able to display it.

Btw, the Font type that I use is Dialog. Did try on other Font type that been supported by the browser (IE), M JVM and Sun JVM like, SimSun, SansSerif,etc...

Below is the code on how I do it.

.....

Font font = new Font("Dialog", Font.PLAIN, 12);

Button addButton = new Button();

addButton.setFont(font);

addButton.setLabel("\u6E05\u9664");

.....

As far as I know is, diff browser will have diff Font type that been supported by them.For example, IE only support Font type of SinSun, SinHei,NSinSun, and Microsoft Sans Serif....and I have try all the font type, still can't able to work it out. Hope you guys can share with me, what are the things that I miss out. Thank you.

[1054 byte] By [Ken_Leea] at [2007-10-1 20:32:02]
# 1

Forget about AWT. Use Swing instead.

Actually, I've been testing and comparing i18n supports in AWT and Swing and I've come to the conclusion that AWT is *out*.

I'm using Swing in Java 1.5 and so far window title, menu, textarea, filechooser, etc display correctly Chinese characters.

I had once tried Swing in Java 1.4 and some components like menu can't display Chinese. Anyway, it's time to drop Java 1.4.

horiniusa at 2007-7-13 2:31:17 > top of Java-index,Desktop,I18N...