2017-02-27 54 views
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); 
    } 
} 
+1

改變編碼格式看看這個http://www.rgagnon.com/javadetails/java-0136.html – Zia

+1

這在macOS上正常工作。很可能您使用的字體不包含該字符。 –

+0

謝謝,它更新後工作正常 – naresh

回答

2

這個盒子符號通常是你的字體不支持這種性格的標誌。沒有什麼可以使用支持它的字體來代替當前的字體。

較新版本的Arial支持這個,所以也許你的系統需要更新。

+0

謝謝你,它的工作正常後,上升 – naresh