public static void main(String[] args) {


		PopupMenu trayMenu = new PopupMenu();
		
		MenuItem captureItem = new MenuItem("Capture in 3 seconds");
		captureItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					Thread.sleep(3000);
					
					Robot robot = new Robot();
					Rectangle screenRect =  new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
					BufferedImage imgTmp = robot.createScreenCapture(screenRect);
					
					Capture capt = new Capture(imgTmp, "Capt001");
					
					Editor editor = new Editor(capt);
					EditorController ec = new EditorController(editor);
					
				} 
				catch (InterruptedException e1) {
					e1.printStackTrace();
				}
				catch (AWTException e2) {
					e2.printStackTrace();
				}
			}
		});
		trayMenu.add(captureItem);
		
		MenuItem exitItem = new MenuItem("Exit");
		exitItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		trayMenu.add(exitItem);
		
		if (SystemTray.isSupported()) {
			SystemTray tray = SystemTray.getSystemTray();
			
			Image icon = Toolkit.getDefaultToolkit().getImage("icon.png");
			TrayIcon trayIcon = new TrayIcon(icon, "ScrCapt");
			trayIcon.setImageAutoSize(true);
			trayIcon.setPopupMenu(trayMenu);
			
			try {
				tray.add(trayIcon);
			}
			catch (Exception e) {
				System.err.println("TrayIcon could not be added.");
			}
			
		}

		
		

		

	}