JDK-8170421 : Ensemble8 black flash at startup on b145+
  • Type: Bug
  • Component: javafx
  • Sub-Component: samples
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-11-28
  • Updated: 2020-05-02
  • Resolved: 2016-11-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u152Fixed 9Fixed
Related Reports
Relates :  
Relates :  
Description
Ensemble8 used to show a neutral gray on startup before its content loaded, but now it shows black which is visually disturbing.

This is likely due to a bug fix in b145 that now starts honoring the scene bg color that used to be ignored.  Ensemble8 is setting the initial scene bg to black for some reason even though its content is mostly gray or white based...
Comments
Thanks for confirming. I verified that the patch applies cleanly. This is approved for backporting to 8u-dev for 8u152.
20-01-2017

Yes, that will be good plus it is a simple fix to backport.
20-01-2017

We need to backport this to FX 8u-dev since we the Ensemble8 applet that we host on OTN is built from FX 8u-dev (so it will run on both JDK 8 and JDK 9). Chien: do you see any problem with backporting this?
20-01-2017

Changeset: 429c7f161b78 Author: ckyang Date: 2016-11-30 09:40 -0800 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/429c7f161b78
30-11-2016

I didn't think there would be and I'm not sure there's even a way to refer to it using the selectors since it is above the root of the hierarchy.
30-11-2016

A good question as to whether you can set the Scene fill with css. I don't think so, but we could check. Answering my own question. The following is from the CSS reference: "The Scene object has no settable CSS properties, nor does it have any pseudo���classes."
30-11-2016

That looks fine to me. +1
30-11-2016

Ah, if it was f4f4f4 then that Color constant was really close, but I agree that using the actual f4f4f4 is best. +1 It would be nice if CSS provided a way to set the scene background so that all styling choices could be made from CSS, but I guess the Scene object is outside the hierarchy...?
30-11-2016

Here is the revised change with a brief comment: diff --git a/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java b/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java --- a/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java +++ b/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java @@ -336,7 +336,9 @@ @Override public void start(final Stage stage) throws Exception { // CREATE SCENE - scene = new Scene(root, 1024, 768, Color.BLACK); + // #f4f4f4 is the background color defined in the css resource and SourceTab.java + scene = new Scene(root, 1024, 768, Color.web("#f4f4f4")); if (IS_EMBEDDED || IS_ANDROID) { new ScrollEventSynthesizer(scene);
30-11-2016

I had the same question, so discussed offline with Chien. The Ensemble background, used in both its css file and in one place in Java code, is "#f4f4f4". I recommend using Color.web("#f4f4f4") as the Scene fill color.
30-11-2016

Why WHITESMOKE instead of WHITE? It's close, but I only see one use of WHITESMOKE in the app and it is for one of the samples, but a lot of the CSS uses WHITE as the background. I also looked for uses of "#f5f5f5" which would be equivalent to WHITESMOKE.
30-11-2016

Please review this simple one line fix: diff --git a/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java b/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java --- a/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java +++ b/apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java @@ -336,7 +336,7 @@ @Override public void start(final Stage stage) throws Exception { // CREATE SCENE - scene = new Scene(root, 1024, 768, Color.BLACK); + scene = new Scene(root, 1024, 768, Color.WHITESMOKE); if (IS_EMBEDDED || IS_ANDROID) { new ScrollEventSynthesizer(scene); }
29-11-2016

This was the result of the fix to JDK-8088179. Ensemble8 shouldn't set its Scene fill to Black if that isn't what is expected: apps/samples/Ensemble8/src/app/java/ensemble/EnsembleApp.java: scene = new Scene(root, 1024, 768, Color.BLACK);
28-11-2016