package ch.zhaw.photoflow;

import java.util.logging.Level;
import java.util.logging.Logger;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import ch.zhaw.photoflow.controller.MainController;
import ch.zhaw.photoflow.core.PhotoFlow;

public class Main extends Application {
	
	public static final PhotoFlow photoFlow = new PhotoFlow();


	public static void main(String[] args) {
		launch(Main.class, args);
	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		
		//View
		try {
			//main View
			 FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("view/main_gui.fxml"));
			    fxmlLoader.setController(new MainController(photoFlow.getProjectDao()));
			   // fxmlLoader.setRoot(this);
			    Parent root = (Parent)fxmlLoader.load();

			    
				Scene scene = new Scene(root);
				primaryStage.setScene(scene);
				primaryStage.getIcons().add(new Image("file:resources/app_icon_32.png"));
				primaryStage.setTitle("Photo Flow");
				
				primaryStage.show();	
			} catch (Exception ex) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
			System.out.println("I failed :-(");
			}	
		}
}

@@ -21,16 +21,37 @@
 oflow;%0A%0A
+import java.net.URL;%0A
 import j
@@ -1008,62 +1008,48 @@
 %09%09%09%09
-primaryStage.getIcons().add(new Image(%22file:r
+URL imagepath = getClass().getR
 esource
-s/
+(%22
 app_
@@ -1061,16 +1061,106 @@
 32.png%22)
+;%0A%09%09%09%09Image image = new Image(imagepath.toString());%0A%09%09%09%09primaryStage.getIcons().add(image
 );%0A%09%09%09%09p

Fix FavIcon für Windows Clients