Good afternoon, I'd like to know how I can make my loading Stage absolute on my main Stage. Since, according to the code below, I'm defining X / Y based on my main Stage, but when moving the main Stage with the mouse, the Stage of loading gets shifted Ex:
private static void createModalLoadingTask() {
if(MODAL == null){
try {
MODAL = new Stage(StageStyle.TRANSPARENT);
FXMLLoader modalLoader = new FXMLLoader(Esign.class.getResource("/test/LoadingModal.fxml"));
AnchorPane ap = (AnchorPane) modalLoader.load();
MODAL.initModality(Modality.NONE);
MODAL.initStyle(StageStyle.UNDECORATED);
MODAL.initOwner(primaryStage);
MODAL.setOpacity(MODAL_OPACITY);
alignSplash();
Scene s = new Scene(ap);
s.setFill(null);
MODAL.setScene(s);
} catch (IOException e) {
LOG.error(e.getMessage());
}
}
}
private static void alignSplash() {
MODAL.setX(primaryStage.getX()+INCREMENT_X);
MODAL.setY(primaryStage.getY()+INCREMENT_Y);
}