• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with AWT and Unicode

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that AWT components doesn't render Unicode characters well.

I have an applet that contains:

...
String str = "ma\u010Dak";
...
Checkbox r_button = new Checkbox();
r_button.setLabel(str);
...

Previous code doesn't render unicode char \u010D well. It renders small box sign.
But if I switch to Swing, everything works OK:

...
String str = "ma\u010Dak";
...
JRadioButton r_button = new JRadioButton();
r_button.setText(str);
...

Q: How can I make AWT display Unicode chars correctly?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!