Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing resource properties from fxml

I know I can internationalize JavaFX application within fxml file by writing something like this <Label id="versionLabel" text="%appVersion" />. But what if I want to use a concatenation of two resource items. I have tried this <Label id="versionLabel" text="%appVersion.prefix%appVersion.number" /> but it does not work. How to do it correctly?

like image 222
user1278890 Avatar asked Nov 19 '25 22:11

user1278890


2 Answers

I'm not sure if this is possible. (but I might be wrong)

You might want to file an enhancement request: http://javafx-jira.kenai.com

As a work-around you could set the text in the controller.

like image 58
Puce Avatar answered Nov 24 '25 11:11

Puce


Another way

<HBox spacing="0">
  <children>
    <Label id="versionLabel1" text="%appVersion.prefix" />
    <Label id="versionLabel2" text="%appVersion.number" />
  </children>
</HBox>
like image 30
Uluk Biy Avatar answered Nov 24 '25 11:11

Uluk Biy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!