White box / window flicker upon launch

Tom Schindl tom.schindl at bestsolution.at
Wed Apr 22 18:17:16 UTC 2020

yes I do but I think this is by nature:

a) you use CSS so only after the first CSS-Pass the color could be set
    appropriately, this CSS pass could happen after the Native-Window is
    => you can mitigate that a bit using
    root.setBackground(new Background(new BackgroundFill(Color.ORANGE,
       CornerRadii.EMPTY, Insets.EMPTY)));

b) if the above gives you short flash (IMHO shorter than with CSS) and
    you can see that by setting eg RED or GREEN as the Scene-Fill so then
    it gets more prominent

So the flash is gone if you put the same color to Scene.setFill() as 
your root-Pane but now something slightly unexpected happens. The trim 
is colored slighly in your scene-color ;-)


Am 22.04.20 um 19:46 schrieb Dirk Lemmermann:
> import javafx.application.Application;
> import javafx.scene.Scene;
> import javafx.scene.layout.VBox;
> import javafx.stage.Stage;
> public class BugDemo extends Application {
>      public void start(Stage stage) {
>          VBox root = new VBox();
>          root.setStyle("-fx-background-color: orange;");
>          Scene scene = new Scene(root, 1000, 800);
>          stage.setScene(scene);
>          stage.show();
>      }
>      public static void main(String[] args) {
>          launch(args);
>      }
> }

More information about the openjfx-dev mailing list