Font Awesome with Swing

前端 未结 2 649
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-06 05:12

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

2条回答
  •  爱一瞬间的悲伤
    2020-12-06 05:39

    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);
    

提交回复
热议问题