publicclassHBoxExampleextendsApplication { @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 HBox class HBoxhbox=newHBox(); //Setting the space between the nodes of a HBox pane hbox.setSpacing(10); //Setting the margin to the nodes hbox.setMargin(textField, newInsets(20, 20, 20, 20)); hbox.setMargin(playButton, newInsets(20, 20, 20, 20)); hbox.setMargin(stopButton, newInsets(20, 20, 20, 20)); //retrieving the observable list of the HBox ObservableListlist= hbox.getChildren(); //Adding all the nodes to the observable list (HBox) list.addAll(textField, playButton, stopButton); //Creating a scene object Scenescene=newScene(hbox); //Setting title to the Stage stage.setTitle("Hbox Example"); //Adding scene to the stage stage.setScene(scene); //Displaying the contents of the stage stage.show(); } publicstaticvoidmain(String args[]){ launch(args); } }