1. 社区版idea2024,新建项目
2. 将项目改成springboot框架,pom文件需要添加springboot依赖管理器和启动包,新建springboot启动类HelloMain.class,删除HelloApplication.class中的main方法,启动HelloMain会报错:module com.example.csdn_demo does not open com.example.csdn_demo to unnamed module @71c7db30,
package com.example.csdn_demo;
import javafx.application.Application;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class HelloMain {
public static void main(String[] args) {
SpringApplication.run(HelloMain.class,args);
Application.launch(HelloApplication.class,args);
}
}
package com.example.csdn_demo;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class HelloApplication extends Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
Scene scene = new Scene