2017-06-11 6 views
0

J'ai créé un wich projet contient une simple fenêtre avec des contenus graphiques en utilisant le constructeur de scène (FXML), je suis arrivé cette erreur:Erreur JavaFX: l'emplacement n'est pas défini?

ici une capture du code: code capture

java.lang.IllegalStateException: Location is not set. 
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2434) 
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409) 
at application.Main.start(Main.java:16) 
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) 
+0

Ne pas envoyer de code en tant qu'images. https://meta.stackoverflow.com/questions/285551/why-not-to-upload-images-of-code-on-so-when-asking-a-question –

Répondre

0

changer la vue chargeur vers (ligne 14):

final FXMLLoader fxmlLoader = 
new FXMLLoader(this.getClass().getResource("/MaScene.fxml"); 
+0

Oui Oui Cela fonctionne. Merci pour votre aide ^^ –

+0

Super @AmineKaa Veuillez accepter la réponse (marquer comme résolue) :) –