0

One of my coworkers created a mock-up of a JavaFX GUI using Netbeans. I am now in charge of turning it into a first prototype of the app. I imported the generated Java and FXML files in my Eclipse, but when I try to run it it fails to display the button icons.

The icons are declared in the FXML file as follows:

<?import com.gluonhq.charm.glisten.control.Icon?>

<Icon content="FILE_DOWNLOAD" prefHeight="112.0" prefWidth="119.0" />

But the result when I run it is just an empty rectangles: https://i.stack.imgur.com/0ODfh.jpg

I tried to add a Maven dependency to MaterialDesignIcons (which apparently what Gluon uses to get the icons), but it didn't change anything. I also tried to run Maven in debug mode, but I don't see any warning or error related to this issue.

Gaëtan
  • 779
  • 1
  • 8
  • 26
  • 3
    `Icon` class belongs to Gluon Mobile library (which is commercial, btw), and its css is enabled only if your application class extends from `MobileApplication`, which is intended for mobile apps (though it can run on desktop as well). – José Pereda Jun 29 '20 at 17:12
  • I would suggest trying https://kordamp.org/ikonli/. – SedJ601 May 18 '22 at 03:19

1 Answers1

0

Use FontAwesomeFX

They have a library for MaterialDesign and Material Icons as well...

https://bitbucket.org/Jerady/fontawesomefx

https://bintray.com/jerady/maven/FontAwesomeFX/view

trilogy
  • 1,738
  • 15
  • 31