resources paths

This commit is contained in:
2022-06-08 12:30:28 +02:00
parent 6d8aab1d7f
commit 1bb3acfb9c
4 changed files with 79 additions and 4 deletions

View File

@ -67,8 +67,12 @@ public class Main extends Application
public void start(Stage primaryStage)
{
try {
FXMLLoader loader = new FXMLLoader(
getClass().getResource("/fxml/MainWindow.fxml"));
FXMLLoader loader = new FXMLLoader();
//TODO Path
loader.setLocation(Main.class.getResource("../../../../resources/fxml/MainWindow.fxml"));
//System.out.println(Main.class.getResource("../../../../resources/fxml/MainWindow.fxml").toString());
//System.exit(1);
AnchorPane pane = loader.load();
primaryStage.setTitle("Stoppuhr");
Scene scene = new Scene(pane);
@ -77,7 +81,7 @@ public class Main extends Application
*
*/
scene.getStylesheets().add(
Main.class.getResource("/css/application.css").toExternalForm());
Main.class.getResource("../../../../resources/css/application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();