You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@OverRide
public void start(Stage primaryStage) {
try {
//load the FXML file
FXMLLoader loader = new FXMLLoader(getClass().getResource("/BistroBliss/src/main/java/com/example/bistrobliss/RoleSelection.fxml"));
Parent root;
root = loader.<Parent>load();
//set the scene
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.setTitle("BistroBliss - Role Selection");
primaryStage.show();
//get the controller and set the image
RoleSelection controller = loader.getController();
controller.setImage();
} catch (IOException e) {
e.printStackTrace();
}
}
@FXML
private ImageView imageView;
public void setImage() {
// Load the image and set it to the ImageView
Image image = new Image(Objects.requireNonNull(getClass().getResourceAsStream("BistroBliss.jpg")));
imageView.setImage(image);
}
}
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1147)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml@22-ea/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2561)
at javafx.fxml@22-ea/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2536)
at com.example.bistrobliss/com.example.bistrobliss.BistroBliss.start(BistroBliss.java:82)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
at javafx.graphics@22-ea/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics@22-ea/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@22-ea/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
... 1 more
Exception running application com.example.bistrobliss.BistroBliss
The text was updated successfully, but these errors were encountered:
@OverRide
public void start(Stage primaryStage) {
try {
//load the FXML file
FXMLLoader loader = new FXMLLoader(getClass().getResource("/BistroBliss/src/main/java/com/example/bistrobliss/RoleSelection.fxml"));
package com.example.bistrobliss;
import javafx.fxml.FXML;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.util.Objects;
public class RoleSelection {
}
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1147)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml@22-ea/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2561)
at javafx.fxml@22-ea/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2536)
at com.example.bistrobliss/com.example.bistrobliss.BistroBliss.start(BistroBliss.java:82)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
at javafx.graphics@22-ea/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics@22-ea/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@22-ea/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
... 1 more
Exception running application com.example.bistrobliss.BistroBliss
The text was updated successfully, but these errors were encountered: