Krzysztof Skolimowski
Krzysztof Skolimowski

Reputation: 491

How to attach Font Awesome icon to a button using only fxml

I am working on JavaFX GUI. I wanted to use Font Awesome icons. I found really cool lib FontAwesomeFX » 8.9 which allows to use icons in fxml code like this:

                 <FontAwesomeIcon fill="red" glyphName="NAME" />

Does anyone know how to attach it to the button using only fxml, so I can style it using css?

Upvotes: 2

Views: 2817

Answers (1)

JustinMartinDev
JustinMartinDev

Reputation: 639

 <JFXButton fx:id="delete_btn" text="Supprimer le client">
     <graphic>
         <FontAwesomeIconView fill="WHITE" glyphName="TRASH_ALT" size="16.0"/>
     </graphic>
 </JFXButton>

I use an other library (JFoenix) but it's the same thing with JButton

Upvotes: 2

Related Questions