public class MotoreDiRicercaPane extends VBox { private final static double gap = (0.8 * Font.getDefault().getSize()); private Button cercaButton; private Button msfButton ; private Label label; private TextField text; public MotoreDiRicercaPane() { super(gap); cercaButton = new Button("Cerca"); msfButton = new Button("Mi sento fortunato"); label = new Label("Inserisci parola da ricercare"); text = new TextField(); setup(); } public void setup() { HBox northPane = new HBox(gap); HBox southPane = new HBox(gap); northPane.getChildren().addAll(label, text);; southPane.getChildren().addAll(cercaButton, msfButton); southPane.setAlignment(Pos.CENTER); getChildren().addAll(northPane, southPane); northPane.setPadding(new Insets(gap)); southPane.setPadding(new Insets(gap)); } }