package teste3; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class TestButtons extends Application { public static void main(String[] args) { launch(); } @Override public void start(Stage stage) throws Exception { HBox root; stage.setScene(new Scene(root = new HBox(), 300, 300)); Button button = new Button("Button1"); button.setVisible(false); root.getChildren().add(button); Button button2 = new Button("Button2"); root.getChildren().add(button2); Button button3 = new Button("Button3"); root.getChildren().add(button3); stage.show(); } }