public static void main(String[] args) throws Exception { initLogging(); mainFrame = new MainFrame(); operatingSystem = System.getProperty("os.name"); CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("h", "help", false, "Print this usage information"); options.addOption( "t", "test", true, "Name of the Bat-File which is executed for Compilation and Unit-Testing"); options.addOption( "r", "run", true, "Name of the Bat-File which is executed for Compilation and running the project"); options.addOption( "f", "folder", true, "Name of the Folder in which the exercises for the Experiment are stored"); CommandLine commandLine = parser.parse(options, args); // read from command line if (commandLine.getOptions().length > 0) { readCommandLine(commandLine, options); } // read from property file else { readPropertyFile(); } checkBatFile(); mainFrame.init(); mainFrame.setSize(800, 600); mainFrame.setVisible(true); mainFrame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { addLineToLogFile("[Close] Emperior"); System.exit(0); } }); mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); addLineToLogFile("[Start] Emperior"); makeContiniousCopys(); }
public static void main(String[] args) { final MainFrame mf = new MainFrame(); mf.addWindowListener( new WindowAdapter() { public void windowClosed(WindowEvent e) { mf.setVisible(false); System.exit(0); } public void windowClosing(WindowEvent e) { mf.setVisible(false); System.exit(0); } }); mf.setVisible(true); }