0

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();
    }
}
tnoel999888
  • 584
  • 3
  • 12
  • 29
  • A bit strange but try to put the maximize line just next to : Stage newStage = new Stage(); to allow more millisecond to you program to do it, is your computer fast enough ? because i never had this problem – azro Feb 11 '17 at 23:22
  • @azro Thanks, I actually managed to fix the problem by making my window 1920x1080 in size, so it maximises pretty much instantaneously – tnoel999888 Feb 14 '17 at 13:33

0 Answers0