-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSystemLogAnalyzerApp.java
More file actions
45 lines (34 loc) · 1.32 KB
/
SystemLogAnalyzerApp.java
File metadata and controls
45 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.project.authapi.system_log_analyzer;
import com.project.authapi.system_log_analyzer.controller.WelcomeViewFXController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
public class SystemLogAnalyzerApp extends Application {
private ConfigurableApplicationContext springContext;
@Override
public void init() {
springContext = new SpringApplicationBuilder(SystemLogAnalyzerSpringBoot.class).run();
}
@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/WelcomeView.fxml"));
loader.setControllerFactory(springContext::getBean);
loader.setController(springContext.getBean(WelcomeViewFXController.class));
Parent root = loader.load();
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.setTitle("System Log Analyzer");
primaryStage.show();
}
@Override
public void stop() {
springContext.close();
}
public static void main(String[] args) {
launch(args);
}
}