【发布时间】:2017-02-27 11:11:40
【问题描述】:
我尝试使用以下代码显示卢比符号。但在输出中我得到一个盒子符号而不是卢比:
代码:
public class Applet extends JApplet {
public static final String RUPEE = "\u20B9";
public void init () {
setLayout(new FlowLayout());
JLabel b = new JLabel("rupee : " + RUPEE +123);
b.setFont(new Font("Arial", Font.PLAIN, 14));
add(b);
}
}
【问题讨论】:
-
这在 macOS 上运行良好。您使用的字体很可能不包含该字符。
-
感谢更新后一切正常