Scene Width and Height, if not specified, result in no window being shown

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: javafx
    • None

      It is possible to create a Scene without specifying the width or height. If the scene has no intrinsic size (for example, if an empty group was specified as the content of the scene), then no window is shown. Instead, we should pick some size by default in such situations so that the window is at least shown. I would suggest a 320x200 default size. Any display in the last two decades will be able to show it, including most (all?) embedded screens we're targeting.


      public class StartupApp extends Application {

          @Override
          public void start(Stage stage) throws Exception {
              Scene scene = new Scene(new Group(), Color.FLORALWHITE);
              stage.setScene(scene);
              stage.show();
          }

          /**
           * Java main for when running without JavaFX launcher
           */
          public static void main(String[] args) {
              launch(args);
          }
      }

            Assignee:
            Anthony Petrov (Inactive)
            Reporter:
            Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: