Search code examples
javaswingunicodevirtual-keyboard

Swing JLabel display unicode " \u21B5 " as text not working


I am working with virtual keyboard in my application. I tried to display the arrow keys in the keyboard by unicodes, Some unicodes are displaying correctly others displaying as junk.

Ex:

\u2191 - Displaying
\u21B5 - Not displaying

Solution

  • Make sure your OS includes a font that supports unicode.

    Try one of the fonts from this list: http://unicode.org/resources/fonts.html