Search in sources :

Example 1 with ExceptionHandler

use of thread.ExceptionHandler in project Botnak by Gocnak.

the class Boot method main.

public static void main(final String[] args) {
    /* Thread-safe initialization */
    Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler());
    Runtime.getRuntime().addShutdownHook(new ShutdownHook());
    EventQueue.invokeLater(new Runnable() {

        @Override
        public void run() {
            setLookAndFeel();
            GUIMain g = new GUIMain();
            g.setVisible(true);
            if (GUIUpdate.checkForUpdate()) {
                GUIUpdate gu = new GUIUpdate();
                gu.setVisible(true);
            }
        }

        /**
             * Tries to set the swing look and feel.
             * All relevant exceptions are caught.
             */
        private void setLookAndFeel() {
            try {
                Settings.LAF.load();
                UIManager.setLookAndFeel(Settings.lookAndFeel);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}
Also used : ExceptionHandler(thread.ExceptionHandler) ShutdownHook(thread.ShutdownHook) GUIMain(gui.forms.GUIMain) GUIUpdate(gui.forms.GUIUpdate)

Aggregations

GUIMain (gui.forms.GUIMain)1 GUIUpdate (gui.forms.GUIUpdate)1 ExceptionHandler (thread.ExceptionHandler)1 ShutdownHook (thread.ShutdownHook)1