英文:
Exception running application LoginApp.LoginApplication
问题
以下是翻译好的部分:
我对编程相当新,只是在按照一个YouTube视频进行操作,但在尝试运行我的简单程序时出现了以下错误。
package LoginApp;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class LoginApplication extends Application {
public void start(Stage stage) throws Exception {
Parent root = (Parent) FXMLLoader.load(getClass().getResource("Login.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("NHL Database System");
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
截图:
我该如何修复这个问题?代码看起来完全没问题。可能是IntelliJ IDEA的配置问题,或者发生了其他情况。我正在按照这个YouTube视频(https://www.youtube.com/watch?v=h1rYlMrvNyE)操作,但在进行了10分钟后,无法让窗口在运行程序时弹出。
英文:
I'm fairly new to coding and was just following a Youtube video and I'm getting the below error when trying to run my simple program.
package LoginApp;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class LoginApplication extends Application {
public void start(Stage stage)throws Exception{
Parent root = (Parent) FXMLLoader.load(getClass().getResource("Login.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("NHL Database System");
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Screenshot:
How can I fix this? I looks like the code is completely fine. Something with configuring IntelliJ IDEA or something happened. I'm following this Youtube video (https://www.youtube.com/watch?v=h1rYlMrvNyE) and only made it 10 minutes in before I couldn't get the window to pop-up when running the program.
专注分享java语言的经验与见解,让所有开发者获益!
评论