Question: i keep having an error in my JavaFX build - Caused by: java.lang.NullPointerException: Location is required this is my fxml code : package application; /application/Main.fxml
i keep having an error in my JavaFX build - Caused by: java.lang.NullPointerException: Location is required

this is my fxml code :

package application;
"/application/Main.fxml"
and this is my main class :

package application; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.BorderPane; import javafx.fxml.FXMLLoader;
public class Main extends Application { @Override public void start(Stage primaryStage) { try { BorderPane root = FXMLLoader.load(getClass().getResource("/sample.fxml")); Scene scene = new Scene(root,400,400); scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.show(); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) { launch(args); } }
please help
Main (5) (Java Application) C:\Program Files Javaljdk1.8.0 231\bin\javaw.exe (Jan 13, 2021, 5:17:59 PM) java.lang.NullPointerException: Location is required. at javafx.fxml.FXML Loader.load Impl(EXML Loader.java:3207) at javafx.fxml.FXML Loader.loadImpl(FXML Loader.java:3175) at javafx.fxml.FXML Loader.load Impl(FXML Loader.java:3148) at javafx.from. FXML Loader.load Impl(EXAL Loader.java:3124) at javafx.fxml.FXML Loader.load Impl(FXML Loader.java:3104) at javafx.fxml.FXML Loader.load(FXML Loader.java:3897) at application.Main.start(Main.java:14) at com.sun.javafx.application. LauncherImpl. lambdalaunchApplication1$8(LauncherImpl.java:863) at com.sun.javafx application.Platform Impl. lambdasrunAndWait$7(Platform Impl.java:326) at com.sun.javafx.application.Platform Impl.lambda null$5(Platform Impl.java:295) at java.security.AccessController.doPrivileged (Native Method) at com.sun.javafx application.Platform Impl. lambdasrunater 56(Platform Impl.java:294) at com.sun.glass.ui. InvokelaterDispatchersFuture.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win. WinApplication. _runLoop(Native Method) at com.sun.glass.ui.win. WinApplication.lambdanull54(WinApplication.java:186) at java.lang.Thread.run(Thread.java:748) hertone prethelpt 21.00 s/vefs.com/favor... 17 fever.com/f/1" celler Anchorane prefight2.c" prefather scaleShape="false" style.fr-background-color: #33346;"> (Talvie Pievie" ly")+"layout"2.0"prefeige."pre". Tablecolumn to decorath"225.0"text"Customer 20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
