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

Controls disappear if stage.show() called in wrong order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u6
    • javafx
    • None
    • Mac OS 10.7

      I ran a bad test program and noticed if stage.show() is before any controls are added to scene graph then they would not show up. But primitive graphics do (rect). In JavaFX 2.2 promoted build 08 this was not a problem.

      I am getting the following error:
      SEVERE: javafx.scene.control.Control impl_processCSS The -fx-skin property has not been defined in CSS for Button@5d3e754f[styleClass=button]

      Suggesting some new change adds dependency of stage init and css.

      To reproduce run the below code snipped. Proved screen shots of same code for different builds.

      public class ControlsDepShowStage extends Application {
          public static void main(String[] args) {
              launch(args);
          }
          @Override
          public void start(Stage stage) {
              StackPane root = new StackPane();
              stage.setScene(new Scene(root, 300, 250));
              // Trigger bug: Show stage before adding control to SG
              stage.show();
              Button btn = new Button("Hello");
              root.getChildren().add(btn);

              Rectangle rect = new Rectangle(10, 10, 10, 10);
              root.getChildren().add(rect);
      // primaryStage.show();
          }
      }

            dgrieve David Grieve
            thor Thor Johannesson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: