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

TilePane within HBox creates extra space

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:

      Description

      If I place a TilePane inside a HBox, it creates extra space, which is not used. It seems, the more children I add to the TilePane, the larger the extra space becomes.

      setMaxHeight() and so on, does not have any effect.

      This is related to RT-20209.



      Sample:


      import javafx.application.Application;
      import javafx.geometry.Orientation;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.TilePane;
      import javafx.scene.layout.VBoxBuilder;
      import javafx.stage.Stage;


      public class TestApp4 extends Application {

          public static void main(String[] args) {
              launch(args);
          }

          @Override
          public void start(final Stage stage) throws Exception {
              HBox root = new HBox();

              TilePane tilePane = new TilePane();
              tilePane.setStyle("-fx-border-color:red");
              tilePane.setOrientation(Orientation.HORIZONTAL);
              tilePane.setPrefColumns(5);
              //tilePane.setMaxHeight(Control.USE_PREF_SIZE);
              //tilePane.setMinHeight(Control.USE_PREF_SIZE);
              tilePane.getChildren().addAll(new Button("Test"), new Button("Test"), new Button("Test"), new Button("Long Text"));

              //root.setMaxHeight(Control.USE_COMPUTED_SIZE);
              root.getChildren().addAll(tilePane);

              Scene scene = new Scene(VBoxBuilder.create().children(root, new Button("NEU")).build());
              stage.setScene(scene);
              stage.show();
          }
      }

        Attachments

          Activity

            People

            Assignee:
            msladecek Martin Sládeček
            Reporter:
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: