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

Region setPrefSize behaves differently if width == Double.MAX_VALUE versus height == Double.MAX_VALUE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u40
    • javafx
    • None
    • Mac, Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b21), JavaFX runtime b1165

      In the following sample, if the pref size of the pane is 100, Double.MAX_VALUE, I would expect a 100 px wide window that fills the height of the screen. The window is the right width, but the height is zero (or darned close - maybe one or two px). RT-38193 not withstanding, if the pref size is Double.MAX_VALUE, 100 we get a 100px high window that spans the width of the screen (as expected).

          @Override
          public void start(Stage primaryStage) {
              Pane pane = new Pane();
      // pane.setPrefSize(Double.MAX_VALUE, 100);
              pane.setPrefSize(100,Double.MAX_VALUE);
              Scene scene = new Scene(pane);
              primaryStage.setScene(scene);
              primaryStage.show();
          }

            Unassigned Unassigned
            dgrieve David Grieve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Imported: