public static void main(String args[]) {
		
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException e) {
			ErrorLogger.error(e, "Couldn't set look and feel.", false, false);
		} catch (InstantiationException e) {
			ErrorLogger.error(e, "Couldn't set look and feel.", false, false);
		} catch (IllegalAccessException e) {
			ErrorLogger.error(e, "Couldn't set look and feel.", false, false);
		} catch (UnsupportedLookAndFeelException e) {
			ErrorLogger.error(e, "Couldn't set look and feel.", false, false);
		}
		
		Session.getDB(); // opens the db
		
		try {
			Session.baseSession();
		} catch (SQLException ex) {
			ErrorLogger.error(ex, "well darn.", true, true);
			System.exit(1);
		}
		
		try {
			if (!User.userExists("user")) {
				sampledata();
				User testUser = new User("user", true, "password", "Janet",
						"michhead", "This is a note.");
				testUser.save();
				Session.endCurrentSession();
			}
		} catch (SQLException ex) {
			ErrorLogger.error(ex, "something went wrong lel", true, true);
		} catch (RecordNotFoundException ex) {
			ErrorLogger.error(ex, "something went wrong lel", true, true);
		}
		final JDialog splash = new JDialog();
		
		URL loading_URL = MainWindow.class.getClassLoader().getResource(
				"ISIS/misc/Loading.gif");
		Splash splashPanel = new Splash(loading_URL);
		splash.setContentPane(splashPanel);
		splash.setSize((splashPanel.image.getWidth(splashPanel) / 2),
				(splashPanel.image.getHeight(splashPanel) / 2));
		splash.setUndecorated(true);
		splash.setAlwaysOnTop(true);
		splash.setLocationRelativeTo(null);
		splash.setVisible(true);
		Timer dispose = new Timer(1500, new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent evt) {
				splash.setVisible(false);
				splash.dispose();
				java.awt.EventQueue.invokeLater(new Runnable() {
					@Override
					public void run() {
						SwingUtilities.invokeLater(new Runnable() {
							@Override
							public void run() {
								// Login frame =
								new Login();
							}
						});
					}
				});
			}
		});
		dispose.setRepeats(false);
		dispose.start();
		
		Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
			@Override
			public void run() {
				Session.getDB().close();
			}
		}, "Shutdown-thread"));
	}