I think this is a bug … I will create a ticket for it. When this behaviour was fixed for Swing in Java 6 it made a huge difference in the perception of the quality and performance of Java applications. Could do the same for JavaFX.
Dirk > On 22 Apr 2020, at 20:17, Tom Schindl <tom.schi...@bestsolution.at> wrote: > > 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 > shown > => 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 ;-) > > Tom > > 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); >> } >> }