I want my Javafx FXML application to start maximized so I used the method setMaximized(true) in my stage.
The program opens as Maximized no problem on that, but the problem is that there is a small black area that flashes for half a second on the application startup just before the window appears.
Here's a recording (gif) of what I describe:

I figured out that the problem is with the scene as it is trying to open in its prefWidth & prefHeight then it scales up to fit the stage. How can I fix this and make the program start as normal programs do?
here's my start() method:
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("editor.fxml"));
primaryStage.setTitle("Simple Text Editor");
primaryStage.setScene((new Scene(root)));
primaryStage.setMaximized(true);
primaryStage.show();
}
primaryStage.setResizable(false);, instead of the white and black rectangles, it shows a small window that suddenly get maximized. - Linuslabo