I am using FontAwesomeFX in my project and added a FontAwesomeIconView
inside a button with glyph name property set to WINDOW_MINIMIZE
. This part can be seen as XML as below.
<Button fx:id="minimizeButton" mnemonicParsing="false">
<graphic>
<FontAwesomeIconView fill="WHITE" glyphName="WINDOW_MINIMIZE" />
</graphic>
</Button>
The problem is, it shows up successfully in SceneBuilder as seen below:
However, when I boot up the program, I see these in debug logs:
Dec 21, 2017 11:49:50 PM de.jensd.fx.glyphs.GlyphIcon updateIcon
SEVERE: Icon 'WINDOW_MINIMIZE' not found. Using 'ANCHOR' (default) instead
And the application shows ANCHOR
instead of WINDOW_MINIMIZE
.
I have also applied this CSS rule due to sizing problems with FontAwesomeIconView
s according to this answer (just in case it is related to the problem):
.glyph-icon{ -fx-font-family:"FontAwesome"; }
Why Different Imports in SceneBuilder and Maven
As you can see in Environment section below, I imported different thing in my Maven configuration file and SceneBuilder.
Well, the reason is, oddly, SceneBuilder does not see FontAwesomeIconView
when you import de.jensd:fontawesomefx:8.9
, that's why I imported de.jensd:fontawesomefx-fontawesome:4.7.0-9.1.2
in SceneBuilder and it works well with Maven import.
So, why didn't I do the other way? I mean, why didn't I import de.jensd:fontawesomefx-fontawesome:4.7.0-9.1.2
in my pom.xml
. Strangely, it is compiled in Java 9 and my project is running on Java 8. Naturally, it threw class version exception or something like that. Also, I didn't have any idea if the migration to Java 9 would cause more trouble, so I didn't import it in pom.xml
.
Environment
- Java 1.8.0_151
- JavaFX 8.0.151 build 12
- SceneBuilder 9.0.1
- de.jensd:fontawesomefx-fontawesome:4.7.0-9.1.2 (Scenebuilder)
- [GroupID] de.jensd [ArtifactID] fontawesomefx [Version] 8.9 (in
pom.xml
)