import javafx.application.Application; import javafx.collections.ObservableList; import javafx.geometry.Insets; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.stage.Stage; import javafx.scene.layout.VBox; publicclassVBoxExampleextendsApplication { @Override publicvoidstart(Stage stage) { //creating a text field TextFieldtextField=newTextField(); //Creating the play button ButtonplayButton=newButton("Play"); //Creating the stop button ButtonstopButton=newButton("stop"); //Instantiating the VBox class VBoxvBox=newVBox(); //Setting the space between the nodes of a VBox pane vBox.setSpacing(10); //Setting the margin to the nodes vBox.setMargin(textField, newInsets(20, 20, 20, 20)); vBox.setMargin(playButton, newInsets(20, 20, 20, 20)); vBox.setMargin(stopButton, newInsets(20, 20, 20, 20)); //retrieving the observable list of the VBox ObservableListlist= vBox.getChildren(); //Adding all the nodes to the observable list list.addAll(textField, playButton, stopButton); //Creating a scene object Scenescene=newScene(vBox); //Setting title to the Stage stage.setTitle("Vbox Example"); //Adding scene to the stage stage.setScene(scene); //Displaying the contents of the stage stage.show(); } publicstaticvoidmain(String args[]){ launch(args); } }