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

Empty GridPane with percentWidth and percentHeight doesn't fit properly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      Javafx JDK 2.1 b14, Java SE 7u3 JRE i586
      Ubuntu 11.10 x64

      Description

      I create a gridpane with 100 rows constraints with percentHeight = 1 and 100 columns with percentWidth = 1, and set it root of a scene.
      For some sizes, last columns or rows are compressed or stretched in a very strange way.
      Perfectly visible with this size for columns :

      package test;

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.ColumnConstraints;
      import javafx.scene.layout.GridPane;
      import javafx.scene.layout.RowConstraints;
      import javafx.stage.Stage;

      public class Test extends Application {
      public static void main(String[] args) {
      launch();
      }

      @Override
      public void start(Stage stage) throws Exception {
      GridPane gp = new GridPane();
      RowConstraints rowConstraint;
      ColumnConstraints columnConstraint;
      for (int x = 0; x < 100; x++) {
      rowConstraint = new RowConstraints();
      rowConstraint.setPercentHeight(1);
      gp.getRowConstraints().add(rowConstraint);
      columnConstraint = new ColumnConstraints();
      columnConstraint.setPercentWidth(1);
      gp.getColumnConstraints().add(columnConstraint);
      }
      gp.setGridLinesVisible(true);
      Scene scene = new Scene(gp, 744, 451);
      stage.setScene(scene);
      stage.show();

      }
      }

       

        Attachments

          Activity

            People

            • Assignee:
              msladecek Martin Sládeček
              Reporter:
              pmarsonjfx Pitt Marson (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: