title: JavaFX - Trying to popup a screen when clicking on button
body: <p>I'm trying to build a Library Management System, In the Home page I want when the user clicks a button it should popup that screen (for example - if I click add members button Add Members screen should popup and the user should be able to access it)</p>
  <p>I have tried googling the error but to no avail</p>
  <p>Error -</p>
  <pre><code>Exception in thread &quot;JavaFX Application Thread&quot; java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1862)
      at javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1729)
      at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
      at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
      at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8889)
      at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
      at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
      at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
      at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
      at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
      at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
      at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
      at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
      at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
      at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
      at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
      at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3856)
      at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1851)
      at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2584)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
      at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
      at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
      at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
      at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
      at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
      at java.base/java.lang.Thread.run(Thread.java:832)
  Caused by: java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
      at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
      at javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
      at javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1857)
      ... 46 more
  Caused by: java.lang.NullPointerException
      at java.base/java.util.Objects.requireNonNull(Objects.java:208)
      at Home.HomeController.loadWindow(HomeController.java:42)
      at Home.HomeController.loadAddBooks(HomeController.java:21)
      ... 57 more
  
  Process finished with exit code 0
  </code></pre>
  <p>Home.fxml -</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  
      &lt;?import javafx.geometry.Insets?&gt;
      &lt;?import javafx.scene.control.Button?&gt;
      &lt;?import javafx.scene.control.ListView?&gt;
      &lt;?import javafx.scene.control.Menu?&gt;
      &lt;?import javafx.scene.control.MenuBar?&gt;
  &lt;?import javafx.scene.control.MenuItem?&gt;
  &lt;?import javafx.scene.control.Tab?&gt;
      &lt;?import javafx.scene.control.TabPane?&gt;
      &lt;?import javafx.scene.control.TextField?&gt;
      &lt;?import javafx.scene.layout.AnchorPane?&gt;
      &lt;?import javafx.scene.layout.BorderPane?&gt;
      &lt;?import javafx.scene.layout.HBox?&gt;
      &lt;?import javafx.scene.layout.StackPane?&gt;
      &lt;?import javafx.scene.layout.VBox?&gt;
      &lt;?import javafx.scene.text.Font?&gt;
      &lt;?import javafx.scene.text.Text?&gt;
  
  &lt;StackPane maxHeight=&quot;-Infinity&quot; maxWidth=&quot;-Infinity&quot; minHeight=&quot;-Infinity&quot; minWidth=&quot;-Infinity&quot; prefHeight=&quot;700.0&quot; prefWidth=&quot;1000.0&quot; xmlns=&quot;http://javafx.com/javafx/16&quot; xmlns:fx=&quot;http://javafx.com/fxml/1&quot; fx:controller=&quot;Home.HomeController&quot;&gt;
     &lt;children&gt;
        &lt;BorderPane prefHeight=&quot;200.0&quot; prefWidth=&quot;200.0&quot;&gt;
           &lt;top&gt;
              &lt;MenuBar BorderPane.alignment=&quot;CENTER&quot;&gt;
                &lt;menus&gt;
                  &lt;Menu mnemonicParsing=&quot;false&quot; text=&quot;File&quot;&gt;
                    &lt;items&gt;
                      &lt;MenuItem mnemonicParsing=&quot;false&quot; text=&quot;Close&quot; /&gt;
                    &lt;/items&gt;
                  &lt;/Menu&gt;
                  &lt;Menu mnemonicParsing=&quot;false&quot; text=&quot;Edit&quot;&gt;
                    &lt;items&gt;
                      &lt;MenuItem mnemonicParsing=&quot;false&quot; text=&quot;Delete&quot; /&gt;
                    &lt;/items&gt;
                  &lt;/Menu&gt;
                  &lt;Menu mnemonicParsing=&quot;false&quot; text=&quot;Help&quot;&gt;
                    &lt;items&gt;
                      &lt;MenuItem mnemonicParsing=&quot;false&quot; text=&quot;About&quot; /&gt;
                    &lt;/items&gt;
                  &lt;/Menu&gt;
                &lt;/menus&gt;
              &lt;/MenuBar&gt;
           &lt;/top&gt;
           &lt;right&gt;
              &lt;VBox prefHeight=&quot;673.0&quot; prefWidth=&quot;198.0&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;
                 &lt;children&gt;
                    &lt;Button fx:id=&quot;AddMem&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#loadAddMembers&quot; prefHeight=&quot;103.0&quot; prefWidth=&quot;198.0&quot; text=&quot;Add Member&quot;&gt;
                       &lt;VBox.margin&gt;
                          &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;20.0&quot; /&gt;
                       &lt;/VBox.margin&gt;
                    &lt;/Button&gt;
                    &lt;Button fx:id=&quot;AddBook&quot; layoutX=&quot;20.0&quot; layoutY=&quot;20.0&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#loadAddBooks&quot; prefHeight=&quot;103.0&quot; prefWidth=&quot;198.0&quot; text=&quot;Add Book&quot;&gt;
                       &lt;VBox.margin&gt;
                          &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;20.0&quot; /&gt;
                       &lt;/VBox.margin&gt;
                    &lt;/Button&gt;
                    &lt;Button fx:id=&quot;ViewMem&quot; layoutX=&quot;20.0&quot; layoutY=&quot;143.0&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#loadViewMembers&quot; prefHeight=&quot;103.0&quot; prefWidth=&quot;198.0&quot; text=&quot;View Members&quot;&gt;
                       &lt;VBox.margin&gt;
                          &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;20.0&quot; /&gt;
                       &lt;/VBox.margin&gt;
                    &lt;/Button&gt;
                    &lt;Button fx:id=&quot;ViewBook&quot; layoutX=&quot;20.0&quot; layoutY=&quot;266.0&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#loadViewBooks&quot; prefHeight=&quot;103.0&quot; prefWidth=&quot;198.0&quot; text=&quot;View Book &quot;&gt;
                       &lt;VBox.margin&gt;
                          &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;20.0&quot; /&gt;
                       &lt;/VBox.margin&gt;
                    &lt;/Button&gt;
                    &lt;Button layoutX=&quot;20.0&quot; layoutY=&quot;389.0&quot; mnemonicParsing=&quot;false&quot; prefHeight=&quot;103.0&quot; prefWidth=&quot;198.0&quot; text=&quot;Settings&quot;&gt;
                       &lt;VBox.margin&gt;
                          &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;20.0&quot; /&gt;
                       &lt;/VBox.margin&gt;
                    &lt;/Button&gt;
                 &lt;/children&gt;
              &lt;/VBox&gt;
           &lt;/right&gt;
           &lt;center&gt;
              &lt;TabPane prefHeight=&quot;200.0&quot; prefWidth=&quot;200.0&quot; tabClosingPolicy=&quot;UNAVAILABLE&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;
                &lt;tabs&gt;
                  &lt;Tab text=&quot;Issue&quot;&gt;
                    &lt;content&gt;
                      &lt;AnchorPane minHeight=&quot;0.0&quot; minWidth=&quot;0.0&quot; prefHeight=&quot;180.0&quot; prefWidth=&quot;200.0&quot;&gt;
                             &lt;children&gt;
                                &lt;VBox prefHeight=&quot;642.0&quot; prefWidth=&quot;802.0&quot; AnchorPane.bottomAnchor=&quot;0.0&quot; AnchorPane.leftAnchor=&quot;0.0&quot; AnchorPane.rightAnchor=&quot;0.0&quot; AnchorPane.topAnchor=&quot;0.0&quot;&gt;
                                   &lt;children&gt;
                                      &lt;HBox prefHeight=&quot;200.0&quot; prefWidth=&quot;802.0&quot;&gt;
                                         &lt;children&gt;
                                            &lt;TextField alignment=&quot;CENTER&quot; promptText=&quot;Enter Book ID&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;90.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                            &lt;/TextField&gt;
                                            &lt;VBox alignment=&quot;CENTER&quot; prefHeight=&quot;200.0&quot; prefWidth=&quot;634.0&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;20.0&quot; left=&quot;20.0&quot; right=&quot;20.0&quot; top=&quot;20.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                               &lt;children&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;55.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;BOOK ID&quot; wrappingWidth=&quot;178.884765625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;BOOK NAME&quot; wrappingWidth=&quot;178.08837890625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;23.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;BOOK AUTHOR&quot; wrappingWidth=&quot;180.43017578125&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;39.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;BOOK PUBLISHER&quot; wrappingWidth=&quot;180.6640625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                               &lt;/children&gt;
                                            &lt;/VBox&gt;
                                         &lt;/children&gt;
                                      &lt;/HBox&gt;
                                      &lt;HBox layoutX=&quot;10.0&quot; layoutY=&quot;10.0&quot; prefHeight=&quot;200.0&quot; prefWidth=&quot;802.0&quot;&gt;
                                         &lt;children&gt;
                                            &lt;TextField alignment=&quot;CENTER&quot; promptText=&quot;Enter Member ID&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;90.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                            &lt;/TextField&gt;
                                            &lt;VBox alignment=&quot;CENTER&quot; prefHeight=&quot;200.0&quot; prefWidth=&quot;634.0&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;20.0&quot; left=&quot;20.0&quot; right=&quot;20.0&quot; top=&quot;20.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                               &lt;children&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;55.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;MEMBER ID&quot; wrappingWidth=&quot;178.884765625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;MEMBER NAME&quot; wrappingWidth=&quot;178.08837890625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;23.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;MEMBER EMAIL&quot; wrappingWidth=&quot;180.43017578125&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                                  &lt;Text layoutX=&quot;10.0&quot; layoutY=&quot;39.0&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; text=&quot;MEMBER CONTACT&quot; wrappingWidth=&quot;180.6640625&quot;&gt;
                                                     &lt;VBox.margin&gt;
                                                        &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                                     &lt;/VBox.margin&gt;
                                                  &lt;/Text&gt;
                                               &lt;/children&gt;
                                            &lt;/VBox&gt;
                                         &lt;/children&gt;
                                      &lt;/HBox&gt;
                                      &lt;HBox alignment=&quot;CENTER&quot; prefHeight=&quot;243.0&quot; prefWidth=&quot;802.0&quot;&gt;
                                         &lt;children&gt;
                                            &lt;Button mnemonicParsing=&quot;false&quot; styleClass=&quot;action-button&quot; stylesheets=&quot;@homestyle.css&quot; text=&quot;Issue&quot;&gt;
                                               &lt;font&gt;
                                                  &lt;Font name=&quot;DejaVu Sans Mono Bold&quot; size=&quot;30.0&quot; /&gt;
                                               &lt;/font&gt;
                                            &lt;/Button&gt;
                                         &lt;/children&gt;
                                      &lt;/HBox&gt;
                                   &lt;/children&gt;
                                &lt;/VBox&gt;
                             &lt;/children&gt;&lt;/AnchorPane&gt;
                    &lt;/content&gt;
                  &lt;/Tab&gt;
                  &lt;Tab text=&quot;Renew &quot;&gt;
                    &lt;content&gt;
                      &lt;AnchorPane minHeight=&quot;0.0&quot; minWidth=&quot;0.0&quot; prefHeight=&quot;180.0&quot; prefWidth=&quot;200.0&quot;&gt;
                             &lt;children&gt;
                                &lt;BorderPane prefHeight=&quot;642.0&quot; prefWidth=&quot;802.0&quot; AnchorPane.bottomAnchor=&quot;0.0&quot; AnchorPane.leftAnchor=&quot;0.0&quot; AnchorPane.rightAnchor=&quot;0.0&quot; AnchorPane.topAnchor=&quot;0.0&quot;&gt;
                                   &lt;top&gt;
                                      &lt;TextField alignment=&quot;CENTER&quot; prefHeight=&quot;51.0&quot; prefWidth=&quot;50.0&quot; promptText=&quot;Enter Book ID&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;
                                         &lt;BorderPane.margin&gt;
                                            &lt;Insets left=&quot;150.0&quot; right=&quot;150.0&quot; /&gt;
                                         &lt;/BorderPane.margin&gt;
                                      &lt;/TextField&gt;
                                   &lt;/top&gt;
                                   &lt;center&gt;
                                      &lt;ListView prefHeight=&quot;200.0&quot; prefWidth=&quot;200.0&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;
                                         &lt;padding&gt;
                                            &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                         &lt;/padding&gt;
                                      &lt;/ListView&gt;
                                   &lt;/center&gt;
                                   &lt;bottom&gt;
                                      &lt;HBox alignment=&quot;CENTER&quot; prefHeight=&quot;100.0&quot; prefWidth=&quot;200.0&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;
                                         &lt;children&gt;
                                            &lt;Button alignment=&quot;CENTER&quot; mnemonicParsing=&quot;false&quot; styleClass=&quot;action-button&quot; stylesheets=&quot;@homestyle.css&quot; text=&quot;Return&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;20.0&quot; left=&quot;20.0&quot; right=&quot;20.0&quot; top=&quot;20.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                               &lt;padding&gt;
                                                  &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                               &lt;/padding&gt;
                                            &lt;/Button&gt;
                                            &lt;Button mnemonicParsing=&quot;false&quot; styleClass=&quot;action-button&quot; stylesheets=&quot;@homestyle.css&quot; text=&quot;Renew&quot;&gt;
                                               &lt;HBox.margin&gt;
                                                  &lt;Insets bottom=&quot;20.0&quot; left=&quot;20.0&quot; right=&quot;20.0&quot; top=&quot;20.0&quot; /&gt;
                                               &lt;/HBox.margin&gt;
                                               &lt;padding&gt;
                                                  &lt;Insets bottom=&quot;10.0&quot; left=&quot;10.0&quot; right=&quot;10.0&quot; top=&quot;10.0&quot; /&gt;
                                               &lt;/padding&gt;
                                            &lt;/Button&gt;
                                         &lt;/children&gt;
                                      &lt;/HBox&gt;
                                   &lt;/bottom&gt;
                                &lt;/BorderPane&gt;
                             &lt;/children&gt;&lt;/AnchorPane&gt;
                    &lt;/content&gt;
                  &lt;/Tab&gt;
                &lt;/tabs&gt;
              &lt;/TabPane&gt;
           &lt;/center&gt;
        &lt;/BorderPane&gt;
     &lt;/children&gt;
  &lt;/StackPane&gt;
  </code></pre>
  <p>HomeController.java -</p>
  <pre><code>package Home;
  
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  import javafx.stage.StageStyle;
  
  import java.io.IOException;
  import java.util.Objects;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  
  public class HomeController {
  
  @FXML
  void loadAddBooks(ActionEvent event) {
      loadWindow(&quot;/src/AddMember/AddMember.fxml&quot;,&quot;HEY&quot;);
  
  }
  
  @FXML
  void loadAddMembers(ActionEvent event) {
      loadWindow(&quot;/src/AddBook/AddBook.fxml&quot;,&quot;HEY&quot;);
  }
  
  @FXML
  void loadViewBooks(ActionEvent event) {
      loadWindow(&quot;/src/DisplayBook/DisplayBook.fxml&quot;,&quot;HEY&quot;);
  }
  
  @FXML
  void loadViewMembers(ActionEvent event) {
      loadWindow(&quot;src/DisplayMembers/DisplayMembers.fxml&quot;,&quot;HEY&quot;);
  }
  
  void loadWindow(String loc, String title) {
      try {
          Parent parent = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(loc)));
          Stage stage = new Stage(StageStyle.DECORATED);
          stage.setTitle(title);
          stage.setScene(new Scene(parent));
          stage.show();
      } catch (IOException ex) {
          Logger.getLogger(HomeController.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  
  }
  </code></pre>
  <p>HomeMain.java -</p>
  <pre><code>package Home;
  import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.stage.Stage;
  
  public class HomeMain extends Application {
      @Override
      public void start(Stage stage) throws Exception {
          Parent root = FXMLLoader.load(getClass().getResource(&quot;Home.fxml&quot;));
          Scene scene = new Scene(root);
          stage.setScene(scene);
          stage.show();
      }
      public static void main(String[] args){
          launch(args);
      }
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/m1WpN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m1WpN.png" alt="enter image description here" /></a></p>