在控制器中,我有一个
Platform.runLater(new Runnable() {
public void run() {
}
....使用此代码调用方法的代码:
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getResource("Authentify.fxml"));
AuthentifyController ac = new AuthentifyController();
ac.setVocale(true);
fxmlLoader.setController(ac);
Pane containeur = (Pane)((Button) this.button3).getParent();
Pane newLoadedPane = fxmlLoader.load();
Scene scene = new Scene(newLoadedPane);
Stage appStage = (Stage) this.button3.getScene().getWindow();
appStage.setScene(scene);
appStage.show();
新的Scene
已启动,但Platform.runLater
代码同时重新启动
您能否说明如何避免Platform.runLater
Runnable
重启(在新场景启动时停止)?
在此完成课程代码:https://framadrop.org/r/3e1SJpy3BL#QBiSWA9Qh0niQi3Qs1GIIv5aYTxi0KR2CNJgDSgEJBQ=