Dimension screenSize = frame.getToolkit().getScreenSize(); frame.pack(); frame.setLocation( screenSize.width / 2 - frame.getSize().width / 2, screenSize.height / 2 - frame.getSize().height / 2);
    public MegaMek(Frame frame) {        this.frame = frame;        frame.addWindowListener(this);        if(Settings.windowSizeHeight != 0) {            frame.setLocation(Settings.windowPosX, Settings.windowPosY);            frame.setSize(Settings.windowSizeWidth, Settings.windowSizeHeight);        } else {            frame.setSize(800, 600);        }        frame.setBackground(SystemColor.menu);        frame.setForeground(SystemColor.menuText);        showMainMenu();        // echo some useful stuff        System.out.println("Starting MegaMek v" + VERSION + " ...");        System.out.println("Timestamp " + new Date(TIMESTAMP).toString());        System.out.println("Java vendor " + System.getProperty("java.vendor"));        System.out.println("Java version " + System.getProperty("java.version"));        frame.setVisible(true);    }