字体真棒与Swing [英] Font Awesome with Swing

查看:169
本文介绍了字体真棒与Swing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Swing应用程序中使用Font Awesome?
如果可能的话,如何使用带有swing组件的图标(JButton或JLabel)。
我之前用Primefaces应用程序使用了Font Awesome。

解决方案尝试jIconFont(Swing或JavaFX)at < a href =http://jiconfont.github.io/ =noreferrer> http://jiconfont.github.io/

例如:

pre $ Icon icon = IconFontSwing.buildIcon(FontAwesome.SMILE_O,40,new Color(0,150,0));

JLabel label = new JLabel(icon);


Is it possible to use Font Awesome with swing applications? If possible then how to use its icons with swing components (JButton or JLabel). I've used Font Awesome earlier with my Primefaces application.

解决方案

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

Example:

Icon icon = IconFontSwing.buildIcon(FontAwesome.SMILE_O, 40, new Color(0, 150, 0));

JLabel label = new JLabel(icon);

这篇关于字体真棒与Swing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆