Add icons to JButton using custom font from AwesomeFont and unicode characters in Java Swing?

不羁的心 提交于 2019-12-05 01:26:49

I think I solved this actually. The correct character is \uf04b not \u0f4b. Whoops! :)

This is working for me now.

Try jIconFont (Swing or JavaFX) at http://jiconfont.github.io/

Example:

Icon icon = IconFontSwing.buildIcon(FontAwesome.FLOPPY_O, 15);

JButton button = new JButton(icon);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!