【问题标题】:Swing JLabel display unicode " \u21B5 " as text not workingSwing JLabel 将 unicode “\u21B5”显示为文本不起作用
【发布时间】:2017-10-12 20:56:19
【问题描述】:

我正在我的应用程序中使用虚拟键盘。我尝试通过 unicode 显示键盘中的箭头键,一些 unicode 正确显示,其他显示为垃圾。

例如:

\u2191 - Displaying
\u21B5 - Not displaying

【问题讨论】:

  • 你的字体有↵吗?更多here.
  • 我使用的字体不支持该字符。谢谢@CatalinaIsland

标签: java swing unicode virtual-keyboard


【解决方案1】:

确保您的操作系统包含支持 unicode 的字体。

试试这个列表中的一种字体:http://unicode.org/resources/fonts.html

【讨论】:

  • 我可以通过 html 显示 unicode。 JButton label = new JButton("\u21B5"); 但它会导致性能问题,因为我在键盘上有很多按钮。 HTML 渲染是否需要时间!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-07-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-12
  • 1970-01-01
相关资源
最近更新 更多