package com.nilhcem.fakesmtp;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import com.nilhcem.fakesmtp.core.Configuration;
import com.nilhcem.fakesmtp.gui.MainFrame;

/**
 * Entry point of the application.
 *
 * @author Nilhcem
 * @since 1.0
 */
public final class FakeSMTP {
	private FakeSMTP() {
	}

	/**
	 * Sets some specific properties, and runs the main window.
	 * <p>
	 * Before opening the main window, this method will:
	 * <ul>
	 *   <li>set a property for Mac OS X to take the menu bar off the JFrame;</li>
	 *   <li>set a property for Mac OS X to set the name of the application menu item;</li>
	 *   <li>turn off the bold font in all components for swing default theme;</li>
	 *   <li>use the platform look and feel.</li>
	 * </ul>
	 * </p>
	 *
	 * @param args a list of parameters.
	 * @throws ClassNotFoundException if an error happened while setting the system look and feel.
	 * @throws InstantiationException if an error happened while setting the system look and feel.
	 * @throws IllegalAccessException if an error happened while setting the system look and feel.
	 * @throws UnsupportedLookAndFeelException if an error happened while setting the system look and feel.
	 */
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException,
		IllegalAccessException, UnsupportedLookAndFeelException {
		System.setProperty("apple.laf.useScreenMenuBar", "true");
		System.setProperty("com.apple.mrj.application.apple.menu.about.name", Configuration.INSTANCE.get("application.name"));
		UIManager.put("swing.boldMetal", Boolean.FALSE);
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

		new MainFrame();
	}
}

@@ -39,25 +39,23 @@
 java
-x.swing.UIManager
+.awt.EventQueue
 ;%0Aim
@@ -76,40 +76,74 @@
 ng.U
-nsupportedLookAndFeelException;%0A
+IManager;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0Aimp
@@ -340,16 +340,96 @@
 eSMTP %7B%0A
+%09private static final Logger LOGGER = LoggerFactory.getLogger(FakeSMTP.class);%0A%0A
 %09private
@@ -948,558 +948,132 @@
 %0A%09 *
- @throws ClassNotFoundException if an error happened while setting the system look and feel.%0A%09 * @throws InstantiationException if an error happened while setting the system look and feel.%0A%09 * @throws IllegalAccessException if an error happened while setting the system look and feel.%0A%09 * @throws UnsupportedLookAndFeelException if an error happened while setting the system look and feel.%0A%09 */%0A%09public static void main(String%5B%5D args) throws ClassNotFoundException, InstantiationException,%0A%09%09IllegalAccessException, UnsupportedLookAndFeelException %7B%0A
+/%0A%09public static void main(String%5B%5D args) %7B%0A%09%09EventQueue.invokeLater(new Runnable() %7B%0A%09%09%09@Override%0A%09%09%09public void run() %7B%0A%09%09
 %09%09Sy
@@ -1128,16 +1128,18 @@
 true%22);%0A
+%09%09
 %09%09System
@@ -1251,16 +1251,18 @@
 ame%22));%0A
+%09%09
 %09%09UIMana
@@ -1304,16 +1304,29 @@
 FALSE);%0A
+%09%09%09%09try %7B%0A%09%09%09
 %09%09UIMana
@@ -1388,17 +1388,82 @@
 ame());%0A
-%0A
+%09%09%09%09%7D%0A%09%09%09%09catch (Exception e) %7B%0A%09%09%09%09%09LOGGER.error(%22%22, e);%0A%09%09%09%09%7D%0A%09%09
 %09%09new Ma
@@ -1473,13 +1473,24 @@
 rame();%0A
+%09%09%09%7D%0A%09%09%7D);%0A
 %09%7D%0A%7D%0A

Add invokeLater when application initializes GUI