java: start the GUI the proper way, using the EDT
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@597 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
344c34c039
commit
e80daa30de
1 changed files with 11 additions and 1 deletions
|
@ -8,14 +8,24 @@
|
|||
|
||||
package micropolisj;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import micropolisj.gui.MainWindow;
|
||||
|
||||
public class Main
|
||||
{
|
||||
public static void main(String [] args)
|
||||
static void createAndShowGUI()
|
||||
{
|
||||
MainWindow win = new MainWindow();
|
||||
win.setVisible(true);
|
||||
win.doNewCity(true);
|
||||
}
|
||||
|
||||
public static void main(String [] args)
|
||||
{
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
createAndShowGUI();
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue