无论如何将节点文本与FXML文件分开? (像android一样)
<Menu mnemonicParsing="false" text="File">
例如:
<Menu mnemonicParsing="false" text="@string/mnu_file">
答案 0 :(得分:3)
加载fxml时,您可以选择ResourceBundle
。您可以使用fxml中的%<key>
来使用资源包中的属性。
<Menu mnemonicParsing="false" text="%mnu_file">
InputStream is = getClass().getResourceAsStream("myproperties.properties");
Parent p = FXMLLoader.load(getClass().getResource("some.fxml"), new PropertyResourceBundle(is));
mnu_file=File