Launcher now finds and correctly sets main Scene
This commit is contained in:
parent
4e99b1e115
commit
cd7627d36d
5
pom.xml
5
pom.xml
@ -7,6 +7,11 @@
|
||||
<description>Projet de fin d'année de L3</description>
|
||||
<build>
|
||||
<sourceDirectory>src</sourceDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/launcher/ui</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
package launcher;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
@ -19,16 +17,19 @@ import javafx.fxml.*;
|
||||
|
||||
public class Launcher extends Application {
|
||||
|
||||
/*
|
||||
* Start method is used by Launcher as an implementation of the Application class to create a JavaFX thread to display the GUI window
|
||||
*/
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
FileInputStream r_launcher = new FileInputStream("ui/launcher.fxml");
|
||||
FXMLLoader floader = new FXMLLoader();
|
||||
Parent root = floader.load(r_launcher);
|
||||
Scene main = root.getScene();
|
||||
|
||||
Parent root = FXMLLoader.load(getClass().getResource("ui/launcher.fxml"));
|
||||
|
||||
Scene main = new Scene(root);
|
||||
|
||||
primaryStage.setTitle("Boulevard Combattant");
|
||||
|
||||
primaryStage.setScene(main);
|
||||
primaryStage.show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user