如何在Java Swing中显示英镑(£)的标志? [英] How do I show the pound sterling (£) sign in Java Swing?
本文介绍了如何在Java Swing中显示英镑(£)的标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前,我向Java源添加了一英镑(&磅)的符号,并将生成的Swing组件显示为Square(不支持的字符)符号。
Currently, I add a pound sterling (£) sign to the Java source and compile the resulting Swing component shows as the square (unsupported character) symbol.
我怀疑这是一个编码问题,Java源文件被编码为cp1252(Eclipse似乎默认为这个)。解决方法的正确方法是什么?
I suspect it's an encoding problem, the Java source file is encoded as cp1252 (Eclipse seems to default to this). What's the correct way of resolving this?
推荐答案
使用\\\£符号。 此处的示例> unicodes 其他符号的Unicode代码点。
Use the \u00A3 notation. Further examples here for the unicodes Unicode code points for other symbols.
这篇关于如何在Java Swing中显示英镑(£)的标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文