37 lines
1 KiB
Java
37 lines
1 KiB
Java
package fr.univ.lyon1.gui;
|
|
|
|
import fr.univ.lyon1.gui.handlers.ApplicationHandler;
|
|
import fr.univ.lyon1.gui.handlers.ServerConfigurationHandler;
|
|
import javafx.application.Application;
|
|
import javafx.application.Platform;
|
|
import javafx.stage.Stage;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class MainGui extends Application {
|
|
@Override
|
|
public void start(Stage stage) {
|
|
try {
|
|
new ApplicationHandler().launch(stage);
|
|
} catch (IOException e) {
|
|
System.out.println(e.getMessage());
|
|
|
|
// Launch server configuration
|
|
try {
|
|
new ServerConfigurationHandler().launch(stage);
|
|
} catch (IOException ex) {
|
|
// Can not launch server configuration, stop application
|
|
System.exit(1);
|
|
}
|
|
}
|
|
|
|
stage.setOnCloseRequest(event -> {
|
|
Platform.exit();
|
|
System.exit(0);
|
|
});
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
Application.launch(MainGui.class, args);
|
|
}
|
|
}
|