I need two grids in a BorderPane which is placed in a tab. When I add them both everything seems fine, but on launch only the first grid is visible.
This is my code.
public void start(Stage stage) throws Exception {
BorderPane bp = new BorderPane();
GridPane g1 = new GridPane();
g1.add(new Button("b1"), 0, 0);
GridPane g2 = new GridPane();
g2.add(new Button("b2"), 0, 0);
bp.setCenter(g1);
bp.setBottom(g2);
TabPane p = new TabPane();
Tab tab = new Tab("Test tab");
tab.setContent(bp);
p.getTabs().add(tab);
Scene s = new Scene(p);
stage.setScene(s);
stage.show();
}
g2
is not showing up at all. What am I missing?