Giving 2 elements seperate alignments in a single hbox
问题 I am trying to get 2 elements, a button and a label, to have their own individual alignments in a single HBox in javafx. My code thus far: Button bt1= new Button("left"); bt1.setAlignment(Pos.BASELINE_LEFT); Label tst= new Label("right"); tst.setAlignment(Pos.BASELINE_RIGHT); BorderPane barLayout = new BorderPane(); HBox bottomb = new HBox(20); barLayout.setBottom(bottomb); bottomb.getChildren().addAll(bt1, tst); by default, the hbox shoves both elements to the left, next to each other. The