When I open a new window in my application and maximise it using newStage.setMaximized(true);
it shows the animation of the window increasing in size from the default size to the size of the screen, is there any way to disable this animation and swiftly move from one fullscreen window to another upon button click?
Here's my code:
public class HomeController {
@FXML private StackPane ap;
public void ButtonClicked(ActionEvent e) throws IOException {
FXMLLoader loader = new FXMLLoader(getClass().getResource("PitchRecognition.fxml"));
Parent root = (Parent)loader.load();
Stage stage = (Stage) ap.getScene().getWindow();
stage.hide();
Stage newStage = new Stage();
Scene scene = new Scene(root);
newStage.setScene(scene);
newStage.setMaximized(true);
newStage.show();
}
}