FIX:: application classes server+client

This commit is contained in:
mlwauben
2019-03-26 08:25:09 +01:00
parent ec37bdcd79
commit f28a4ea924
2 changed files with 25 additions and 5 deletions

View File

@@ -4,19 +4,24 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import java.io.IOException;
@SpringBootApplication
public class Application extends javafx.application.Application {
private static ConfigurableApplicationContext springContext;
private static final Logger log = LoggerFactory.getLogger(Application.class);
// private static final Logger log = LoggerFactory.getLogger(Application.class);
/**
* This (main) method starts launch.
* @param args the arguments
*/
public static void main(String[] args) {
launch(args);
}
@@ -33,11 +38,19 @@ public class Application extends javafx.application.Application {
return loader.load();
}
/**
* This method initializes the application.
*/
@Override
public void init() throws Exception {
public void init() {
springContext = SpringApplication.run(Application.class);
}
/**
* This method opens the login window.
* @param primaryStage the login window
* @throws Exception in case fxml file is not found
*/
@Override
public void start(Stage primaryStage) throws Exception {
Parent rootNode = load(this.getClass().getClassLoader().getResource("fxml/LoginWindow.fxml"));
@@ -47,8 +60,11 @@ public class Application extends javafx.application.Application {
primaryStage.show();
}
/**
* This method stops the application.
*/
@Override
public void stop() {
springContext.stop();
}
}
}

View File

@@ -6,6 +6,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
/**
* This method starts the server.
* @param args the arguments
*/
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}