MCPcopy Create free account
hub / github.com/Hakky54/java-tutorials / App

Class App

trust-me/src/main/java/nl/altindag/ssl/trustme/App.java:31–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29import java.util.function.Function;
30
31@SpringBootApplication
32public class App extends Application {
33
34 private static final String TITLE = "Trust Me";
35 private ConfigurableApplicationContext applicationContext;
36 private final Function<String, FXMLLoader> fxmlLoaderFunction = fxml -> new FXMLLoader(this.getClass().getResource(fxml));
37
38 private Parent root;
39
40 @Override
41 public void init() throws IOException {
42 applicationContext = new SpringApplicationBuilder(App.class)
43 .headless(false)
44 .run(getParameters().getRaw().toArray(String[]::new));
45
46 FXMLLoader fxmlLoader = fxmlLoaderFunction.apply("/mainscreen.fxml");
47 fxmlLoader.setControllerFactory(applicationContext::getBean);
48 root = fxmlLoader.load();
49 }
50
51 @Override
52 public void start(Stage stage) {
53 Scene scene = new Scene(root);
54 stage.setTitle(TITLE);
55 stage.setScene(scene);
56 stage.setWidth(500);
57 stage.setHeight(400);
58 stage.setResizable(false);
59
60 stage.show();
61 }
62
63 @Override
64 public void stop() {
65 Platform.exit();
66 applicationContext.stop();
67 }
68
69 public static void main(String[] args) {
70 launch(args);
71 }
72
73}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected