publicclassCssExampleextendsApplication { @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 PasswordFieldtextField2=newPasswordField(); //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); //Styling nodes button1.setStyle("-fx-background-color: darkslateblue; -fx-text-fill: white;"); button2.setStyle("-fx-background-color: darkslateblue; -fx-text-fill: white;"); text1.setStyle("-fx-font: normal bold 20px 'serif' "); text2.setStyle("-fx-font: normal bold 20px 'serif' "); gridPane.setStyle("-fx-background-color: BEIGE;"); // Creating a scene object Scenescene=newScene(gridPane); // Setting title to the Stage stage.setTitle("CSS Example"); // Adding scene to the stage stage.setScene(scene); //Displaying the contents of the stage stage.show(); } publicstaticvoidmain(String args[]){ launch(args); } }