Skeleton of simple Spring Boot + JavaFX app
requires Java 13
SpringBootJavaFXApp.java
@SpringBootApplication
public class SpringBootJavaFXApp extends Application {
private ConfigurableApplicationContext applicationContext;
@Override
public void init() throws Exception {
applicationContext = new SpringApplicationBuilder(SpringBootJavaFXApp.class).run();
}
@Override
public void start(Stage primaryStage) {
applicationContext.publishEvent(new StageStartedEvent(primaryStage));
}
@Override
public void stop() throws Exception {
applicationContext.close();
Platform.exit();
}
public static void main(String[] args) {
Application.launch(SpringBootJavaFXApp.class, args);
}
}
links: