@SpringBootApplication
public abstract class FxSpringApplication
extends javafx.application.Application
The usage is examplified in this project's documentation over at Tristan971/EasyFXML.
The gist of it is that your "main" class is expected to extend this class instead of Application (which this
one does extend anyway) and that you just declare your main function with a call to Application.launch(String...). Then
it is expected that your main class is annotated with SpringBootApplication (it is not really needed but IDEs
have a better time when they see it on a project class rather than in a library due to non-inheritance of annotations
in Java) and also with Import(FxSpringContext).
This class initializes the application with a call to beforeSpringInit(), then initializing Spring, then
calling afterSpringInit(). These tho methods can be overriden and you can do calls to springContext
in afterSpringInit(), should you need to do things that require Spring before the UI loads (or beforeSpringInit() in the case of things to do before Spring is even started.
When initialization is done, this class calls your implementation of FxUiManager. You can of course bypass
that, should you not like the layout of FxUiManager, by overriding start(Stage).
FxUiManager| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ConfigurableApplicationContext |
springContext |
| Constructor and Description |
|---|
FxSpringApplication() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterSpringInit() |
protected void |
beforeSpringInit() |
protected org.springframework.boot.builder.SpringApplicationBuilder |
getSab() |
void |
init() |
void |
start(javafx.stage.Stage primaryStage) |
void |
stop() |
protected org.springframework.context.ConfigurableApplicationContext springContext
public void init()
init in class javafx.application.Applicationprotected org.springframework.boot.builder.SpringApplicationBuilder getSab()
protected void beforeSpringInit()
protected void afterSpringInit()
public void start(javafx.stage.Stage primaryStage)
start in class javafx.application.Applicationpublic void stop()
stop in class javafx.application.ApplicationCopyright © 2018. All rights reserved.