If I use a TilePane, I recognized a extra space added to its container.
Run this code: (and replace the tilePane by the hBox in the root.getChildren collection, to see the difference).
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.layout.TilePane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
public static void main(String[] args) {
Application.launch(args);
}
public void start(final Stage stage) throws Exception {
VBox root = new VBox();
TilePane tilePane = new TilePane();
tilePane.getChildren().addAll(new Button(), new Button());
HBox hBox = new HBox();
hBox.getChildren().addAll(new Button(), new Button());
root.getChildren().addAll(tilePane, new Button("Below this Button is a free space"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
Run this code: (and replace the tilePane by the hBox in the root.getChildren collection, to see the difference).
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.layout.TilePane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class TestApp3 extends Application {
public static void main(String[] args) {
Application.launch(args);
}
public void start(final Stage stage) throws Exception {
VBox root = new VBox();
TilePane tilePane = new TilePane();
tilePane.getChildren().addAll(new Button(), new Button());
HBox hBox = new HBox();
hBox.getChildren().addAll(new Button(), new Button());
root.getChildren().addAll(tilePane, new Button("Below this Button is a free space"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
- relates to
-
JDK-8115756 HelloBorderPane stretches up to the full height of the screen
- Resolved