import javafx.application.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.scene.text.*; import javafx.scene.layout.*; import javafx.stage.*; import javafx.*; public class VBox_HBox extends Application { @Override public void start(Stage stage) { stage.setTitle("Motore di ricerca"); Button cercaButton = new Button("Cerca"); Button msfButton = new Button("Mi sento fortunato"); Label label = new Label("Inserisci parola da ricercare"); TextField text = new TextField(); VBox vBox = new VBox(GAP); HBox northPane = new HBox(GAP); HBox southPane = new HBox(GAP); northPane.getChildren().addAll(label, text);; southPane.getChildren().addAll(cercaButton, msfButton); southPane.setAlignment(Pos.CENTER); vBox.getChildren().addAll(northPane, southPane); northPane.setPadding(new Insets(GAP)); southPane.setPadding(new Insets(GAP)); stage.setScene(new Scene(vBox)); stage.show(); } }