publicclassGridPaneExampleextendsApplication { @Override publicvoidstart(Stage stage) { //creating label email Texttext1=newText("Email"); //creating label password Texttext2=newText("Password"); //Creating Text Filed for email TextFieldtextField1=newTextField(); //Creating Text Filed for password TextFieldtextField2=newTextField(); //Creating Buttons Buttonbutton1=newButton("Submit"); Buttonbutton2=newButton("Clear"); //Creating a Grid Pane GridPanegridPane=newGridPane(); //Setting size for the pane gridPane.setMinSize(400, 200); //Setting the padding gridPane.setPadding(newInsets(10, 10, 10, 10)); //Setting the vertical and horizontal gaps between the columns gridPane.setVgap(5); gridPane.setHgap(5); //Setting the Grid alignment gridPane.setAlignment(Pos.CENTER); //Arranging all the nodes in the grid gridPane.add(text1, 0, 0); gridPane.add(textField1, 1, 0); gridPane.add(text2, 0, 1); gridPane.add(textField2, 1, 1); gridPane.add(button1, 0, 2); gridPane.add(button2, 1, 2); //Creating a scene object Scenescene=newScene(gridPane); //Setting title to the Stage stage.setTitle("Grid Pane Example"); //Adding scene to the stage stage.setScene(scene); //Displaying the contents of the stage stage.show(); } publicstaticvoidmain(String args[]){ launch(args); } }