java.lang.IllegalStateException: Location is not set

0 respostas
javafx
A

Boa noite. Gostaria que me ajudassem com um erro no meu JavaFx. Estou tendo problemas para setar o caminho do FXML.

Erro:

Exception in Application start method

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:498)

at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)

at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)

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:498)

at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)

Caused by: java.lang.RuntimeException: Exception in Application start method

at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)

at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$154(LauncherImpl.java:182)

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

Caused by: java.lang.IllegalStateException: Location is not set.

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

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

at javafxmvc.view.main.start(main.java:28)

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

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

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

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

at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(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$147(WinApplication.java:177)

 1 more

Exception running application javafxmvc.view.main

Java Result: 1
Código:

<a class="mention" href="/u/override">@Override</a>

public void start(Stage stage) throws IOException{

FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/views/FXMLVBoxMain.fxml"));

Parent root = loader.load();
stage.setScene(new Scene(root));
    stage.setTitle("Sistema de vendas (JavaFX MVC)");
    stage.setResizable(false);
    stage.show();//mostra..
}

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    launch(args);
}
Criado 12 de dezembro de 2018
Respostas 0
Participantes 1