51 lines
1.4 KiB
Java
51 lines
1.4 KiB
Java
package de.vanitasvitae.fasel;
|
|
|
|
import java.sql.SQLException;
|
|
|
|
|
|
import de.vanitasvitae.fasel.ui.container.LoginController;
|
|
import javafx.application.Application;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
import javafx.stage.Stage;
|
|
|
|
public class FaselApplication extends Application {
|
|
|
|
private Stage primaryStage;
|
|
private static FaselApplication INSTANCE;
|
|
|
|
private FaselApplication() throws SQLException {
|
|
}
|
|
|
|
public static FaselApplication getInstance() throws SQLException {
|
|
if (INSTANCE == null) {
|
|
INSTANCE = new FaselApplication();
|
|
}
|
|
return INSTANCE;
|
|
}
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) throws Exception {
|
|
INSTANCE = this;
|
|
this.primaryStage = primaryStage;
|
|
FXMLLoader loader = new FXMLLoader();
|
|
loader.setLocation(getClass().getResource("/fxml/container/login_container.fxml"));
|
|
Parent root = loader.load();
|
|
LoginController controller = loader.getController();
|
|
controller.setApplication(this);
|
|
Scene scene = new Scene(root, 1200, 741);
|
|
primaryStage.setTitle("Fasel - Login");
|
|
primaryStage.setScene(scene);
|
|
primaryStage.show();
|
|
}
|
|
|
|
public Stage getPrimaryStage() {
|
|
return primaryStage;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
launch(args);
|
|
}
|
|
}
|