title: Error while running Javafx application
body: <p>Hello I am new to Java and I am getting an error while running the application. The application runs but when a button click event <code>createStudent(ActionEvent event)</code> is invoked the errors show. I am pasting the full error stack trace.</p>
  
  <pre><code>javafx.fxml.LoadException: 
  /home/user/IdeaProjects/JavaFxDemo/out/production/JavaFxDemo/resources/fxml/newStudent.fxml
  
      at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2571)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
      at dashboard.Controller.createStudent(Controller.java:145)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
      at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769)
      at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
      at javafx.event.Event.fireEvent(Event.java:198)
      at javafx.scene.Node.fireEvent(Node.java:8411)
      at javafx.scene.control.Button.fire(Button.java:185)
      at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
      at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
      at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
      at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      at javafx.event.Event.fireEvent(Event.java:198)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3757)
      at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:388)
      at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
      at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
      at com.sun.glass.ui.View.notifyMouse(View.java:937)
      at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at com.sun.glass.ui.gtk.GtkApplication.lambda$null$49(GtkApplication.java:139)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
      ... 65 more
  Caused by: java.sql.SQLException: Operation not allowed after ResultSet closed
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
      at com.mysql.jdbc.ResultSet.checkClosed(ResultSet.java:666)
      at com.mysql.jdbc.ResultSet.next(ResultSet.java:7274)
      at dashboard.AdmissionController.initialize(AdmissionController.java:168)
      ... 75 more
  </code></pre>
  
  <p>I checked whether there is any problem with the fxml file in the below location, but there is no problem there.</p>
  
  <pre><code>javafx.fxml.LoadException: 
  /home/user/IdeaProjects/JavaFxDemo/out/production/JavaFxDemo/resources/fxml/newStudent.fxml
  </code></pre>
  
  <p>Please check my Controller files</p>
  
  <p><strong>dashboard.Controller.java</strong></p>
  
  <pre><code>package dashboard;
  
  import java.io.IOException;
  import java.net.URL;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.util.IdentityHashMap;
  import java.util.Observable;
  import java.util.ResourceBundle;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.control.Button;
  import javafx.scene.control.TextField;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import dashboard.StudentMaster;
  import database.DatabaseAccess;
  import javafx.scene.control.cell.PropertyValueFactory;
  import javafx.stage.Modality;
  import javafx.stage.Stage;
  import javafx.stage.StageStyle;
  
  import java.sql.Connection;
  
  public class Controller {
  
  
      private Connection connection;
  
      @FXML
      private ResourceBundle resources;
  
      @FXML
      private URL location;
  
      @FXML
      private TableView&lt;StudentMaster&gt; studentTable;
  
      @FXML
      private TableColumn&lt;StudentMaster, Integer&gt; studID;
  
      @FXML
      private TableColumn&lt;StudentMaster, String&gt; studReg;
  
      @FXML
      private TableColumn&lt;StudentMaster, String&gt; stdAdm;
  
      @FXML
      private TableColumn&lt;StudentMaster, String&gt; stdName;
  
      @FXML
      private TableColumn&lt;StudentMaster, String&gt; stdClass;
  
      @FXML
      private TableColumn&lt;StudentMaster, String&gt; stdDiv;
  
      @FXML
      private TextField regBox;
  
      @FXML
      private TextField admBox;
  
      @FXML
      private TextField nameBox;
  
      @FXML
      private TextField classBox;
  
      @FXML
      private TextField divBox;
  
      @FXML
      private Button searchBtn;
  
      @FXML
      private Button createStudentBtn;
  
      private ObservableList&lt;StudentMaster&gt; data;
  
  
  
      public void buildData(String SQL)
      {
          data = FXCollections.observableArrayList();
          try {
              ResultSet rs = connection.createStatement().executeQuery(SQL);
              while(rs.next())
              {
                  StudentMaster studentData = new StudentMaster();
                  studentData.studentId.set(rs.getInt("student_id"));
                  studentData.stdClass.set(rs.getString("student_std"));
                  studentData.name.set(rs.getString("student_name"));
                  studentData.admNo.set(rs.getString("student_admn_no"));
                  studentData.regno.set(rs.getString("student_regno"));
                  studentData.stdDiv.set(rs.getString("student_div"));
                  data.add(studentData);
                  studentTable.setItems(data);
              }
          } catch (SQLException e) {
              e.printStackTrace();
          }
      }
  
      @FXML
      void initialize() {
          assert studentTable != null : "fx:id=\"studentTable\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert studID != null : "fx:id=\"studID\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert studReg != null : "fx:id=\"studReg\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert stdAdm != null : "fx:id=\"stdAdm\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert stdName != null : "fx:id=\"stdName\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert stdClass != null : "fx:id=\"stdClass\" was not injected: check your FXML file 'dashboard.fxml'.";
          assert stdDiv != null : "fx:id=\"stdDiv\" was not injected: check your FXML file 'dashboard.fxml'.";
  
          DatabaseAccess newConnection = new DatabaseAccess();
          connection = newConnection.startConnection();
          String SQL = "Select * from student";
          buildData(SQL);
          newConnection.shutdown();
  
          loadDataToTable();
  
      }
  
      private void loadDataToTable()
      {
          studID.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, Integer&gt;("studentId"));
          studReg.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, String&gt;("regno"));
          stdName.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, String&gt;("name"));
          stdAdm.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, String&gt;("admNo"));
          stdClass.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, String&gt;("stdClass"));
          stdDiv.setCellValueFactory(new PropertyValueFactory&lt;StudentMaster, String&gt;("stdDiv"));
      }
  
      @FXML
      void createStudent(ActionEvent event)
      {
          FXMLLoader fxmlLoader;
          fxmlLoader = new FXMLLoader(getClass().getResource("/resources/fxml/newStudent.fxml"));
          try {
              Parent root1 = (Parent)fxmlLoader.load();
              AdmissionController admissionController = fxmlLoader.getController();
              admissionController.setStudentData(studentTable.getItems());
              Stage stage = new Stage();
              stage.initModality(Modality.APPLICATION_MODAL);
  //            stage.initStyle(StageStyle.UNDECORATED);
              stage.setTitle("New Admission");
              stage.setScene(new Scene(root1));
              stage.show();
          } catch (IOException e)
          {
              e.printStackTrace();
          }
      }
  
      @FXML
      void searchBtnClicked(ActionEvent event)
      {
          String name = nameBox.getText();
          String regno = regBox.getText();
          String admno = admBox.getText();
          String stdClass = classBox.getText();
  
          String SQL = "Select * from student where student_name like '"+name+"%'";
          System.out.println(SQL);
          DatabaseAccess newConnection = new DatabaseAccess();
          connection = newConnection.startConnection();
          buildData(SQL);
          newConnection.shutdown();
          loadDataToTable();
      }
  
      public void reloadStudentTable()
      {
          loadDataToTable();
      }
  
  }
  </code></pre>
  
  <p><strong>dashboard.AdmissionController.java</strong></p>
  
  <pre><code>package dashboard;
  
  import javafx.beans.property.SimpleStringProperty;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.scene.Node;
  import javafx.scene.control.Button;
  import javafx.scene.control.ChoiceBox;
  import javafx.scene.control.DatePicker;
  import javafx.scene.control.TextArea;
  import javafx.scene.control.TextField;
  import javafx.scene.input.InputMethodEvent;
  import javafx.scene.input.MouseEvent;
  import javafx.stage.Stage;
  import customlib.ExecuteSQL;
  import dashboard.AvailableClasses;
  
  import java.sql.ResultSet;
  import java.sql.SQLException;
  
  public class AdmissionController {
  
  
      @FXML
      private TextField nameBox;
  
      @FXML
      private ChoiceBox&lt;String&gt; classBox;
  
      @FXML
      private ChoiceBox&lt;String&gt; divBox;
  
      @FXML
      private TextField admBox;
  
      @FXML
      private TextField religionBox;
  
      @FXML
      private TextField casteBox;
  
      @FXML
      private TextArea addressBox;
  
      @FXML
      private DatePicker dobBox;
  
      @FXML
      private ChoiceBox&lt;?&gt; sexBox;
  
      @FXML
      private Button resetBtn;
  
      @FXML
      private Button cancelBtn;
  
      @FXML
      private Button doneBtn;
  
      @FXML
      void cancelBtnClicked(ActionEvent event)
      {
  //        GET the current node of the event
          Node node = (Node)event.getSource();
          Stage stage = (Stage)node.getScene().getWindow();
          stage.close();
      }
  
      @FXML
      void classMouseClicked(MouseEvent event) throws SQLException {
          System.out.println("clicked");
      }
  
      private ObservableList&lt;StudentMaster&gt; data ;
      private ObservableList&lt;AvailableClasses&gt;totalClasses;
  
      public void setStudentData(ObservableList&lt;StudentMaster&gt; data)
      {
          this.data = data ;
      }
  
      @FXML
      void doneBtnClicked(ActionEvent event)
      {
          String name = nameBox.getText();
          Integer ref = 1;
          String standard = "1";
          String division  = "A";
          String admissionNo = admBox.getText();
          String sex = "M";
          String religion = religionBox.getText();
          String caste = casteBox.getText();
          String address = addressBox.getText();
          String SQLquery = "INSERT INTO student (student_name," +
                  "fk_grp_ref,"+
                  "student_std," +
                  "student_div," +
                  "student_admn_no," +
                  "student_sex," +
                  "student_religion," +
                  "student_caste," +
                  "student_address) " +
                  "VALUES ('"+name+"','"+ref+"', '"+standard+"'," +
                  " '"+division+"', '"+admissionNo+"', '"+sex+"', " +
                  "'"+religion+"', '"+caste+"', '"+address+"')";
  
          ExecuteSQL newQuery = new ExecuteSQL();
          Integer executeStatus = newQuery.ExecuteSQL(SQLquery);
          if (executeStatus != 0)
          {
              System.out.println("Data Inserted");
          }
          else
          {
              System.out.println("Error in execution");
          }
          StudentMaster student = new StudentMaster();
          StudentMaster studentData = new StudentMaster();
          studentData.name.set(name);
          studentData.admNo.set(admissionNo);
          studentData.stdDiv.set(division);
          studentData.stdClass.set(standard);
          studentData.studentId.set(executeStatus);
          data.add(studentData);
  
  
  
  
  //      Close the Window after successfully inserted
  
          Node node = (Node)event.getSource();
          Stage stage = (Stage)node.getScene().getWindow();
          stage.close();
  
      }
  
      @FXML
      void resetBtnClicked(ActionEvent event) {
          nameBox.setText("");
          addressBox.setText("");
          admBox.setText("");
          dobBox.getEditor().clear();
          religionBox.setText("");
          casteBox.setText("");
      }
  
      @FXML
      void initialize() throws SQLException {
          assert nameBox != null : "fx:id=\"nameBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert classBox != null : "fx:id=\"classBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert divBox != null : "fx:id=\"divBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert admBox != null : "fx:id=\"admBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert religionBox != null : "fx:id=\"religionBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert casteBox != null : "fx:id=\"casteBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert addressBox != null : "fx:id=\"addressBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert dobBox != null : "fx:id=\"dobBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert sexBox != null : "fx:id=\"sexBox\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert resetBtn != null : "fx:id=\"resetBtn\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert cancelBtn != null : "fx:id=\"cancelBtn\" was not injected: check your FXML file 'newStudent.fxml'.";
          assert doneBtn != null : "fx:id=\"doneBtn\" was not injected: check your FXML file 'newStudent.fxml'.";
  
          String query = "select * from class";
          ExecuteSQL newSelectClassesQuery = new ExecuteSQL();
          ResultSet rs = newSelectClassesQuery.GetClassesList(query);
          totalClasses = FXCollections.observableArrayList();
          while(rs.next())
          {
  //            AvailableClasses classesData = new AvailableClasses();
              classBox.getItems().add(rs.getString("class_name"));
          }
          rs.close();
      }
  }
  </code></pre>
  
  <p><strong>ExecuteSQL.java</strong> // To execute my SQL Queries</p>
  
  <pre><code>package customlib;
  
  
  import database.DatabaseAccess;
  
  import java.sql.*;
  
  public class ExecuteSQL {
      private Connection connection;
  
      public Integer ExecuteSQL(String query)
      {
          DatabaseAccess newConnection = new DatabaseAccess();
          connection = newConnection.startConnection();
          try
          {
              PreparedStatement preparedStatement = (PreparedStatement) connection.prepareStatement(query);
              preparedStatement.executeUpdate();
  
              ResultSet rs = connection.createStatement().executeQuery("select last_insert_id() as last_id from student");
              int lastid = 0;
              while(rs.next())
              {
                  lastid = rs.getInt("last_id");
  
              }
  
              newConnection.shutdown();
              return lastid;
  
          }
          catch (SQLException e)
          {
              e.printStackTrace();
              newConnection.shutdown();
              return 0;
          }
  
  
      }
  
      public ResultSet GetClassesList(String query)
      {
          DatabaseAccess newConnection = new DatabaseAccess();
          connection = newConnection.startConnection();
          ResultSet rs;
          try
          {
              rs = connection.createStatement().executeQuery(query);
              newConnection.shutdown();
              rs.close();
              return rs;
  
          }
          catch (SQLException e)
          {
              e.printStackTrace();
              newConnection.shutdown();
              rs = null;
              return rs;
          }
  
      }
  
  
  
  
  }
  </code></pre>
  
  <p><strong>EDIT: Adding newStudent.fxml file</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.control.Button?&gt;
  &lt;?import javafx.scene.control.ChoiceBox?&gt;
  &lt;?import javafx.scene.control.DatePicker?&gt;
  &lt;?import javafx.scene.control.Label?&gt;
  &lt;?import javafx.scene.control.TextArea?&gt;
  &lt;?import javafx.scene.control.TextField?&gt;
  &lt;?import javafx.scene.layout.Pane?&gt;
  &lt;?import javafx.scene.text.Font?&gt;
  
  &lt;Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="700.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dashboard.AdmissionController"&gt;
     &lt;children&gt;
        &lt;Pane layoutX="67.0" layoutY="92.0"&gt;
           &lt;children&gt;
              &lt;TextField fx:id="nameBox" layoutX="64.0" layoutY="1.0" /&gt;
              &lt;ChoiceBox fx:id="classBox" layoutX="299.0" onMouseClicked="#classMouseClicked" prefHeight="26.0" prefWidth="61.0" /&gt;
              &lt;ChoiceBox fx:id="divBox" layoutX="396.0" layoutY="1.0" prefHeight="26.0" prefWidth="61.0" /&gt;
              &lt;Label layoutY="6.0" prefHeight="16.0" prefWidth="49.0" text="Name" /&gt;
              &lt;Label layoutX="257.0" layoutY="6.0" prefHeight="16.0" prefWidth="38.0" text="Class" /&gt;
              &lt;Label layoutX="368.0" layoutY="5.0" prefHeight="16.0" prefWidth="38.0" text="Div" /&gt;
              &lt;TextField fx:id="admBox" layoutX="64.0" layoutY="52.0" /&gt;
              &lt;Label layoutX="2.0" layoutY="57.0" prefHeight="16.0" prefWidth="61.0" text="Adm.No" /&gt;
              &lt;TextField fx:id="religionBox" layoutX="64.0" layoutY="98.0" /&gt;
              &lt;Label layoutX="2.0" layoutY="103.0" prefHeight="16.0" prefWidth="61.0" text="Religion" /&gt;
              &lt;TextField fx:id="casteBox" layoutX="63.0" layoutY="145.0" /&gt;
              &lt;Label layoutX="1.0" layoutY="150.0" prefHeight="16.0" prefWidth="61.0" text="Caste" /&gt;
              &lt;Label layoutX="251.0" layoutY="58.0" prefHeight="16.0" prefWidth="61.0" text="Address" /&gt;
              &lt;TextArea fx:id="addressBox" layoutX="306.0" layoutY="50.0" prefHeight="116.0" prefWidth="267.0" /&gt;
              &lt;Label layoutX="1.0" layoutY="196.0" prefHeight="16.0" prefWidth="61.0" text="DOB" /&gt;
              &lt;DatePicker fx:id="dobBox" layoutX="61.0" layoutY="192.0" prefHeight="26.0" prefWidth="170.0" /&gt;
              &lt;ChoiceBox fx:id="sexBox" layoutX="500.0" layoutY="1.0" prefHeight="26.0" prefWidth="61.0" /&gt;
              &lt;Label layoutX="472.0" layoutY="5.0" prefHeight="16.0" prefWidth="38.0" text="Sex" /&gt;
              &lt;Button fx:id="resetBtn" layoutX="2.0" layoutY="272.0" mnemonicParsing="false" onAction="#resetBtnClicked" text="Reset" /&gt;
              &lt;Button fx:id="cancelBtn" layoutX="425.0" layoutY="271.0" mnemonicParsing="false" onAction="#cancelBtnClicked" text="Cancel" /&gt;
              &lt;Button fx:id="doneBtn" layoutX="512.0" layoutY="269.0" mnemonicParsing="false" onAction="#doneBtnClicked" prefHeight="26.0" prefWidth="62.0" text="Done" /&gt;
           &lt;/children&gt;
        &lt;/Pane&gt;
        &lt;Label layoutX="261.0" layoutY="40.0" prefHeight="25.0" prefWidth="170.0" text="NEW ADMISSION"&gt;
           &lt;font&gt;
              &lt;Font size="20.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
     &lt;/children&gt;
  &lt;/Pane&gt;
  </code></pre>