user1278890
user1278890

Reputation: 663

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?

Upvotes: 3

Views: 530

Answers (2)

Uluk Biy
Uluk Biy

Reputation: 49195

Another way

<HBox spacing="0">
  <children>
    <Label id="versionLabel1" text="%appVersion.prefix" />
    <Label id="versionLabel2" text="%appVersion.number" />
  </children>
</HBox>

Upvotes: 1

Puce
Puce

Reputation: 38132

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.

Upvotes: 1

Related Questions