FOLLOW ME Twitter Facebook Вконтакте LinkedIn RSS Feed

Arrow symbols in Java

Category: Java
Oct 14, 2012
Konstantin Bulenkov

Unicode is a major feature which Java supports perfectly. This means you can use ANY unicode symbols in your code. Arrow symbols are quite useful. Here is so-called “The Unicode Arrows Block” with characters codes. To use arrow symbols in a Java application just write something like this:

String msg = "Press \u2191 button to go up";

or, if your favorite editor supports unicode, copy and paste any symbol from here

String msg = "Press ↑ button to go up";
  0 1 2 3 4 5 6 7 8 9 A B C D E F
\u219x
\u21Ax
\u21Bx
\u21Cx
\u21Dx
\u21Ex
\u21Fx

2 Comments

  • IIRC unfortunately not all fonts support all symbols properly.. at least some on win

    • Unfortunately, yes. I use arrows in IntelliJ IDEA code (in File Structure Popup) and I check that the current font supports Arrows Block by

      font.canDisplay('\u2191');

      Ubuntu font also does not support arrows :-(

Leave a comment