I have decided to end the project for the time being to work on other projects. However, the project is still usable, I just won't be developing it anymore. When there is time, I may return to the project, for now the repository is archived. |
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:
FontAwesomeSolid
– for these iconsFontAwesomeRegular
– for these iconsFontAwesomeBrands
– for these icons
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>
Each usage requires the jIconFont library.
If you are using this library as Maven dependency, this requirement will be attached automatically.
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);
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);
- Go to this page: https://fontawesome.com/icons and find icon, which you want to use.
- Check if it is NOT pro icon.
- Check what style the icon belongs to and select a class accordingly:
FontAwesomeSolid
,FontAwesomeRegular
orFontAwesomeBrands
. - Copy icon ID and use it as
FontAwesomeSolid.ICON_ID
(all in upper case and replace dashes with underscores).