The main class in a JavaFX FXML application includes the code for setting up the application and defining the stage and scene, code example
Example: refrence xml textfield in javafx
fx:controller=<Controller.Location>
@FXML TextField textfield;
fx:id=<idFromController>
textfield.getText();
textfield.setText();