2

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:

FontAwesomeIconView WINDOW_MINIMIZE

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.

FontAwesomeIconView Anchor icon

I have also applied this CSS rule due to sizing problems with FontAwesomeIconViews 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)
Eray Erdin
  • 2,633
  • 1
  • 32
  • 66

1 Answers1

1

Well, I dig through a bit and saw that, oddly, FontAwesomeIcon enum in de.jensd:fontawesomefx:8.9 (which is the latest version in Maven Central Repository) does not contain any WINDOW_MINIMIZE icon.

That's why, I changed my icon to something else that is in FontAwesomeIcon. That solved my issue for now, yet this question is still open for further answers.

Eray Erdin
  • 2,633
  • 1
  • 32
  • 66
  • 1
    Did you see this at the project's [repo](https://bitbucket.org/Jerady/fontawesomefx) `Since FontAwesomeFX 8.10 I moved to Bintray, so you have to add the bintray repo to you build file as it is not yet available at Maven Central!`. You have new releases [here](https://bintray.com/jerady/maven/FontAwesomeFX/view). – José Pereda Dec 21 '17 at 22:27
  • Whoa, I seem to not recognize it, let me try it. I will add further details to this answer. Thanks. – Eray Erdin Dec 21 '17 at 22:30