public static void main(final String[] args) {
		//Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
		String fileToOpen = null;
		boolean isOpeningClipboard = false;
		try{			
			for(int i=0;i<args.length;++i){
				String arg = args[i];
				if (arg.startsWith("-")){
					if (arg.equals("-c") || arg.equals("--clipboard")){
						isOpeningClipboard = true;
					}else if(arg.equals("-h") || arg.equals("--help")){
						System.out.println(CMDLINE_HELP_TEXT);
						System.exit(0);
					}else
						throw new RuntimeException("Unexpected argument: "+arg);
				}else{
					if (fileToOpen != null){
						throw new RuntimeException("Unexpected argument: "+arg);
					}else{
						fileToOpen = arg;
					}
				}
			}
		}catch (Exception e){
			System.err.println("Error: "+e.getMessage());
			System.exit(1);
		}
		final String fFileToOpen = fileToOpen;
		final boolean fOpenClipboard = isOpeningClipboard;
		
		javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI(fOpenClipboard, fFileToOpen);
            }
        });
	}