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

Document that Modena uses a non-transparent background by default

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8u40
    • 8, 8u20
    • javafx
    • Windows 7x64

      Take the following simple program:


      public class Test extends Application {

          @Override
          public void start(Stage primaryStage) {
              
              new TextArea(); //Comment this out to enable transparency
              
              Stage stage = new Stage();
              stage.initStyle(StageStyle.TRANSPARENT);
              Text text = new Text("Is this transparent?");
              VBox box = new VBox();
              box.getChildren().add(text);
              final Scene scene = new Scene(box, 300, 250);
              scene.setFill(null);
              stage.setScene(scene);
              stage.show();
              
          }

      }


      It should just create a simple transparent stage and add some text, but the transparency is broken (window is opaque.) Removing the "new TextArea()" line renders the stage transparent again. This does not just occur with one transparent stage - multiple transparent stages can be added, and as soon as the control is created, they become opaque. (This can be seen more easily by delaying the creation of the text area by a few seconds or so - the stage(s) are then transparent to start with, and become opaque when the control is constructed.)

      Creating any subclass of Control seems to cause this issue - it doesn't matter when it's created, I can also create it after the stage is shown with the same results.

      This bug does not seem to occur with Java 7 / JavaFX 2.x.

            jgiles Jonathan Giles
            mberryjfx Michael Berry (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: