I have the following simple Java test program:
import java.awt.*;
public class test3 {
public test3() {
Frame f = new Frame();
f.setLayout(null);
f.setBounds(50,50, 400,400);
Label l = new Label("你好吗");
l.setBounds(10,100, 50,30);
TextField t = new TextField("你好吗",20);
t.setBounds(100,100,50,30);
f.add(l);
f.add(t);
f.setVisible(true);
}
public static void main(String[] args) {
test3 t = new test3();
}
}
The output of running this test program is 3 square boxes for the label text, and 你好吗 (how are you as in Chinese) in the text field.
TextField
and Label
are awt components, while there is no problem displaying unicode in the text field, not sure how to get Label
to display unicode correctly.