Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8243939

Window flickers upon launch

XMLWordPrintable

    • x86
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      MacOS X, Catalina
      openjdk version "14" 2020-03-17
      OpenJDK Runtime Environment (build 14+36-1461)
      OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      When the stage of an application opens up it first shows its white background before filling it with the content of the root node. This can cause a flicker. On desktop systems this flicker is very short and hardly noticeable but on slower devices, e.g. mobile devices, it becomes very noticeable.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Any application shows this behaviour.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The stage should immediately show the root node of the scenegraph.
      ACTUAL -
      The window is initially empty / white.

      ---------- BEGIN SOURCE ----------
      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);
         }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Theoretically the application could not use CSS but API to fill the background with a color that more resembles the background color of the root node. This way the flicker is less strong.

      FREQUENCY : always


            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: