@Override
	public void run(){
		setSize(new Dimension(Constants.PREFERRED_STARTUP_WINDOW_WIDTH, Constants.PREFERRED_STARTUP_WINDOW_HEIGHT));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		//Add icon
		setIconImage(new ImageIcon(StartUpView.class.getResource("/se/cth/hedgehogphoto/resources/icon.gif")).getImage());
		
		JPanel p = new JPanel();
		JLabel image = new JLabel();
		image.setIcon(new ImageIcon(StartUpView.class.getResource("/se/cth/hedgehogphoto/resources/boot.gif")));
		p.add(image);
		
		LoadingLayer layer = new LoadingLayer(p);
		add(layer.getDecoratedPanel());
		
		//Center the screen
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		int w = getSize().width;
		int h = getSize().height;
		int x = (dim.width-w)/2;
		int y = (dim.height-h)/2;
		setLocation(x, y);
		
		setVisible(true);
		layer.start();
		
		//Start and wait for the database to finish loading
		Thread t = new Thread(DatabaseHandler.getInstance());
		t.start();
		try {
			t.join();
		} catch (InterruptedException e) {
			Log.getLogger().log(Level.WARNING, "Interrupted", e);
		}
		
		layer.stopAndRemove();
	}