0
以下のコードを使用してルピーシンボルを表示しようとしました。しかしin output I'm getting a box symbol instead of rupeeインドルピー記号をJavaで印刷する方法
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);
}
}
エンコード形式を変更します。http://www.rgagnon.com/javadetails/java-0136.html – Zia
これはmacOSではうまく動作します。ほとんどの場合、使用しているフォントにその文字は含まれていません。 –
更新後は正常に動作しています – naresh