This is the updated version of Jensd's library.
The icons are made by Pictogrammers (mdi icons collection). This project is basically a port of the web version for JavaFx with Jensd's codebase.
It's made for Java 17+.
Like my other libraries MaterialDesignFontFX is available on Maven Central.
<dependency>
<groupId>fr.flowarg</groupId>
<artifactId>materialdesignfontfx</artifactId>
<version>VERSION</version>
</dependency>dependencies {
implementation 'fr.flowarg:materialdesignfontfx:VERSION'
}import fr.flowarg.materialdesignfontfx.MaterialDesignIcon;
import fr.flowarg.materialdesignfontfx.MaterialDesignIconView;
public class Main extends Application
{
@Override
public void start(Stage primaryStage)
{
// scene logic
var accountIcon = new MaterialDesignIconView<>(MaterialDesignIcon.A.ACCOUNT);
var yinYangIcon = new MaterialDesignIconView<>(MaterialDesignIcon.Y.YIN_YANG);
// add the icons to your UI
}
}Note : I had to split each letter in a sub-enum because it exceeds the maximum amount of fields a Java class/enum can hold.
The Generator subproject aims to generate the MaterialDesignIcon class with the provided _variables.scss file.