Package com.andrewnatoli.jbug

Source Code of com.andrewnatoli.jbug.JBugTracker

package com.andrewnatoli.jbug;

import com.andrewnatoli.jbug.authentication.MainMenuView;

import javax.swing.*;

/**
* Created by andrew on 4/19/14.
*/
public class JBugTracker {

    public static void main(String[] args) {
        System.out.println("Starting JBugTracker!");
        Configuration.loadConfiguration();


        if(Database.connected == false) {
            System.out.println("Not connected to database.");
            if(Database.connect() == false) {
                System.err.println("Coudln't connect to database!");
                JOptionPane.showMessageDialog(null,"There was an issue connecting to the database!");
                int redoConfig = JOptionPane.showConfirmDialog(null, "Would you like to reconfigure your database?", "Change database configuration?", JOptionPane.YES_NO_OPTION);
                if (redoConfig == JOptionPane.YES_OPTION)
                    Configuration.createNewConfiguration(-2);
                else
                    System.exit(0);
            }
            else {
                System.out.println("Connected.");
                System.out.println("Showing menu.");
                new MainMenuView();
            }
        }
    }

}
TOP

Related Classes of com.andrewnatoli.jbug.JBugTracker

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.