mirror of
https://codeberg.org/qg-info-unterricht/zpg-graphentester.git
synced 2026-03-24 20:48:26 +01:00
45 lines
1.4 KiB
Java
45 lines
1.4 KiB
Java
import javafx.application.Application;
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
import javafx.scene.layout.VBox;
|
|
import javafx.scene.image.Image;
|
|
import javafx.stage.Stage;
|
|
import control.Controller;
|
|
|
|
/**
|
|
* Dies ist die Startklasse für die GUI des Graphentesters
|
|
* In BlueJ gibt es teilweise Probleme, dass die Menüs bei Mausklick nicht
|
|
* offen bleiben. Dann bitte das Programm über die Main-Funktion starten.
|
|
*
|
|
* @author Dirk Zechnall, Thomas Schaller
|
|
* @version 12.02.2021 (v6.6)
|
|
*/
|
|
|
|
public class GraphenTester extends Application {
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) {
|
|
try {
|
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/view/graphenalgorithmen.fxml"));
|
|
Controller c = new Controller();
|
|
loader.setController(c);
|
|
VBox root = (VBox) loader.load();
|
|
Scene scene = new Scene(root);
|
|
Image icon = new Image("/view/icon.png");
|
|
primaryStage.getIcons().add(icon);
|
|
primaryStage.setScene(scene);
|
|
primaryStage.show();
|
|
primaryStage.setOnCloseRequest(e->c.mBeenden(null));
|
|
|
|
|
|
}
|
|
catch(Exception e) {
|
|
System.out.println(e);
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
public static void main(String[] args) {
|
|
new Thread(() -> Application.launch(GraphenTester.class)).start();
|
|
}
|
|
}
|