0

I'm developing a Java application, with a GUI based on JavaFX and JFoenix. Based on information from the database, I want to add a badge showing the number of issues I have with data from the database (looks like number of unread messages in a mail application).

I have been looking for hours to find an example showing me how to use JFXbadge, but did not find anything. Is there anybody who can give me an example in FXML ?

HansR
  • 11
  • 1
  • 3

2 Answers2

0

I scoured the intarwebs and this is the only one I found ...but basically you use it like a Pane.

<JFXBadge fx:id="badge1" position="TOP_RIGHT" text="1" styleClass="icons-badge">
  <StackPane style="-fx-padding: 10;">
    <FontAwesomeIconView glyphName="STAR" size="2em" styleClass="icon"/>
  </StackPane>
</JFXBadge>

The catch here is that it seems that the the library is not loading its .css stylesheets by default...at least for the JFXBadge. so in the above example icons-badge is not going to be resolved unless you "load" the corresponding stylesheet css by specifying stylesheets attribute or assign the css definition in style attribute.

Dexter Legaspi
  • 3,192
  • 1
  • 35
  • 26
-1

here is a github page showing how the JFXBadge is used JFXBadge

Tule Simon
  • 111
  • 6