1. Introduction

Ikonli provides icon packs that can be used in Java applications. Currently Swing and JavaFX UI toolkits are supported.

1.1. Download

Ikonli and all of its icon packs can be downloaded from Bintray download.

You must select a binary that matches your target UI toolkit, such as

Swing

ikonli-swing-1.9.0

JavaFX

ikonli-javafx-1.9.0

Next, select any of the icon packs you want to use. You may select more than one for the same application.

2. Usage

2.1. Swing

The ikonli-swing:1.9.0 JAR provides a new Icon class: org.kordamp.ikonli.swing.FontIcon. You may use this class with any Swing component that supports an Icon property.

2.1.1. Installing

gradle
repositories {
    jcenter()
}

dependencies {
    compile 'org.kordamp.ikonli:ikonli-swing:1.9.0'
}
maven
<dependencies>
    <dependency>
        <groupId>org.kordamp.ikonli</groupId>
        <artifactId>ikonli-swing</artifactId>
        <version>1.9.0</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>central</id>
        <name>jcenter</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>

2.2. JavaFX

The ikonli-javafx:1.9.0 JAR provides a new Node class: org.kordamp.ikonli.javafx.FontIcon. You may use this class with any JavaFX control that accepts a graphic property. You may also use the icon directly as it is a subclass of javafx.scene.text.Text. The icon class can be used inside an FXML file too.

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.GridPane?>
<?import org.kordamp.ikonli.javafx.FontIcon?>

<GridPane prefHeight="60.0" prefWidth="200.0"
          xmlns:fx="http://javafx.com/fxml"
          fx:controller="org.example.AppController">
    <Button GridPane.columnIndex="0" GridPane.rowIndex="0"
            mnemonicParsing="false"
            prefWidth="200.0">
        <graphic>
            <FontIcon iconLiteral="di-java" iconSize="64"/>
        </graphic>
    </Button>
</GridPane>
Icon Literal Syntax

The iconLiteral property accepts any of these formats

  • icon-code

  • icon-code:icon-size

  • icon-code:icon-size:icon-color

where the following rules apply

icon-code

An icon code literal such as di-java.

icon-size

A number (in pixels) specifying the width of the icon.

icon-color

A javafx.scene.paint.Color, javafx.scene.paint.LinearGradient, or javafx.scene.paint.RadialGradient literal.

Examples
di-java
di-java:32
di-java:64:BLUE
Stylable Properties

org.kordamp.ikonli.javafx.FontIcon exposes properties that can be styled using CSS. It defines a node class named ikonli-font-icon.

-fx-icon-code

An icon literal such as di-java or fa-github.

-fx-icon-size

The size of the icon, in pixels.

-fx-icon-color

A JavaFX Paint definition, such as a plain color or gradient.

A stackable version is also available, org.kordamp.ikonli.javafx.StackedFontIcon. This is an specialized version of javafx.scene.layout.StackPane that accepts instances of org.kordamp.ikonli.javafx.FontIcon as child content. You may use this class with FXML, like it’s shown in the following example

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.GridPane?>
<?import org.kordamp.ikonli.javafx.FontIcon?>
<?import org.kordamp.ikonli.javafx.StackedFontIcon?>

<GridPane prefHeight="60.0" prefWidth="200.0"
          xmlns:fx="http://javafx.com/fxml"
          fx:controller="org.example.AppController">
    <StackedFontIcon GridPane.columnIndex="0" GridPane.rowIndex="0" iconSize="48">
        <FontIcon iconLiteral="fa-circle-thin" iconColor="red"/>
        <FontIcon iconLiteral="fa-camera" StackedFontIcon.iconSize="0.5"/>
    </StackedFontIcon>
</GridPane>
Stylable Properties

org.kordamp.ikonli.javafx.StackedFontIcon exposes properties that can be styled using CSS. It defines a node class named stacked-ikonli-font-icon.

-fx-icon-size

The size of the icon, in pixels.

-fx-icon-color

A JavaFX Paint definition, such as a plain color or gradient.

2.2.1. Installing

gradle
repositories {
    jcenter()
}

dependencies {
    compile 'org.kordamp.ikonli:ikonli-javafx:1.9.0'
}
maven
<dependencies>
    <dependency>
        <groupId>org.kordamp.ikonli</groupId>
        <artifactId>ikonli-javafx</artifactId>
        <version>1.9.0</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>central</id>
        <name>jcenter</name>
        <url>http://jcenter.bintray.com</url>
    </repository>
</repositories>

3. Icon Packs

3.1. DevIcons

3.1.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-devicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-devicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.2. Elusive

3.2.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-elusive-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-elusive-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.3. Feather

3.3.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-feather-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-feather-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.4. FontAwesome

3.4.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-fontawesome-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-fontawesome-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.5. Fontelico

3.5.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-fontelico-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-fontelico-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.6. Foundation

3.6.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-foundation-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-foundation-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.7. HawconsFilled

3.7.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-hawconsfilled-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-hawconsfilled-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.8. HawconsStroke

3.8.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-hawconsstroke-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-hawconsstroke-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.9. Icomoon

3.9.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-icomoon-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-icomoon-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.10. Ionicons

3.10.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-ionicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-ionicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.11. Maki

3.11.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-maki-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-maki-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.12. Maki2

3.12.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-maki2-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-maki2-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.13. Material Icons

3.13.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-material-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-material-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.14. MaterialDesign

3.14.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-materialdesign-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-materialdesign-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.15. Metrizeicons

3.15.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-metrizeicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-metrizeicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.16. Octicons

3.16.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-octicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-octicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.17. OpenIconic

3.17.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-openiconic-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-openiconic-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.18. RunestroIcons

3.18.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-runestroicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-runestroicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.19. Typicons

3.19.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-typicons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-typicons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.20. Weathericons

3.20.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-weathericons-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-weathericons-pack</artifactId>
    <version>1.9.0</version>
</dependency>

3.21. Websymbols

3.21.1. Installing

gradle
compile 'org.kordamp.ikonli:ikonli-websymbols-pack:1.9.0'
maven
<dependency>
    <groupId>org.kordamp.ikonli</groupId>
    <artifactId>ikonli-websymbols-pack</artifactId>
    <version>1.9.0</version>
</dependency>