I am building a JavaFX application with multi language support. So while loading the fxml
file by:
AnchorPane page = (AnchorPane) FXMLLoader.load(Main.class.getResource("fxml/RealTimeInitialPanel.fxml"),Language.getBundle());
I am passing the resource bundle based on the default Language
. Above Language
class extends ResourceBundle and returns String based on the current Locale. To change language, I just have to call up Language.setLocale(..)
. Everything works well.
But say now the user changes the language on the go. How do I signal the fxml or UI to refresh the screen. That way they will again call up getString(..)
and the text gets updated based on the setLocale. In swing, it does refresh periodically. But with fx iam unable to