Skip to Main Content

FXML loadException

ramOfficialSep 2 2016 — edited Oct 10 2016

Error:-

javafx.fxml.LoadException:

file:/C:/Users/Ram%20Sundar/Documents/NetBeansProjects/PromaE/dist/run1255715815/PromaE.jar!/promae/Login.fxml

  at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2601)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2579)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3214)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3175)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3148)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3124)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3104)

  at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3097)

  at promae.Maiin.start(Maiin.java:23)

  at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)

  at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)

  at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)

  at java.security.AccessController.doPrivileged(Native Method)

  at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)

  at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

  at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)

  at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)

  at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NullPointerException

  at promae.LoginController.initialize(LoginController.java:28)

  at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)

  ... 17 more

Code:-

package promae;

import javafx.application.Application;

import javafx.fxml.FXMLLoader;

import javafx.scene.Parent;

import javafx.scene.Scene;

import javafx.stage.Stage;

/**

*

* @author Ram Sundar

*/

public class Maiin extends Application {

   

   @Override

    public void start(Stage primaryStage) {

     try{

     Parent root=FXMLLoader.load(getClass().getResource("/promae/Login.fxml"));

    

     Scene scene=new Scene(root);

     scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());

     primaryStage.setScene(scene);

     primaryStage.setTitle("Login");

     primaryStage.show();   

     }   catch(Exception e){

         e.printStackTrace();

     }

    }

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        launch(args);

    }

   

}

Comments
Post Details
Added on Sep 2 2016
4 comments
4,076 views