jIconFont – Font Awesome

Package of latest Font Awesome fonts created for using with jIconFont.


Project maintained by pervoj Hosted on GitHub Pages — Theme by mattgraham

Download: 1.0.2 Font Awesome version: 5.15.3 License: GPL 3.0

What is it?

jIconFont – Font Awesome is Java library, which expands the possibilities of the original library (jIconFont - Font Awesome by Carlos Eduardo Leite de Andrade) and uses latest versions of Font Awesome, and which can be used in Java Swing or JavaFX.

It aims to always be up to date with the latest version of Font Awesome.

For each Font Awesome icon style is there one class. There are three classes:

How to get?

You can download this library from GitHub repository releases, Maven Central repository, or you can use it as Maven dependency:

<dependency>
    <groupId>com.github.pervoj</groupId>
    <artifactId>jiconfont-font-awesome</artifactId>
    <version>1.0.2</version>
</dependency>

Usage

Each usage requires the jIconFont library.

If you are using this library as Maven dependency, this requirement will be attached automatically.

Swing

Using in Swing requires jIconFont - Swing dependency.

How it use? It’s simple. Here is example with solid style:

IconFontSwing.register(FontAwesomeSolid.getIconFont());

Icon icon = IconFontSwing.buildIcon(FontAwesomeSolid.CHECK, 40, new Color(0, 150, 0));
JLabel label = new JLabel(icon);

JavaFX

Using in JavaFX requires jIconFont - JavaFX dependency.

JavaFX usage is simple too:

IconFontFX.register(FontAwesomeSolid.getIconFont());

IconNode iconNode = new IconNode(FontAwesomeSolid.CHECK);
iconNode.setIconSize(40);
iconNode.setFill(Color.DARKGREEN);

How to get icon ID?

  1. Go to this page: https://fontawesome.com/icons and find icon, which you want to use.
  2. Check if it is NOT pro icon.
  3. Check what style the icon belongs to and select a class accordingly: FontAwesomeSolid, FontAwesomeRegular or FontAwesomeBrands.
  4. Copy icon ID and use it as FontAwesomeSolid.ICON_ID (all in upper case and replace dashes with underscores).

Font Awesome Catalog