我想通過刪除舊的anchorPane.Now加載一個新的anchorPane在現有的場景中,我需要顯示用戶加載遊標和用戶執行的操作不應該發生(如按鈕點擊或按鍵)。加載新的anchorPane JavaFX遊標等待
我已經使用但Cursor.WAIT但仍然可以執行操作。
anchorPane.getScene()。SetCursor(Cursor.WAIT);
HomeController controller=new HomeController(stage,anchorPane);
FXMLLoader loader = new FXMLLoader();
loader.setLocation(getClass().getResource("/fxml/home.fxml"));
loader.setController(controller);
Parent root = null;
try {
root=(Parent) loader.load();
} catch (IOException e) {
LOGGER.error("Message is " + e);
e.printStackTrace();
}
anchorPane.getChildren().remove(0);
anchorPane.getChildren().add(root);
我這個code.but我不工作之前已經添加Cursor.WAIT。
看一看[如何顯示在JavaFX的窗格的中心ProgressIndicator ...](http://stackoverflow.com/questions/32794379/how-to-show-progressindicator-in-center- of-pane-in-javafx) – ItachiUchiha