private void setSystemTray() {
		if(tray) {
			if (SystemTray.isSupported()) {
				if(sysTray != null)
					sysTray.remove(trayIcon);
				setDefaultCloseOperation( JFrame.HIDE_ON_CLOSE );
			    sysTray = SystemTray.getSystemTray();
			    Image image =  new ImageIcon((URL)getClass().getResource("/Icons/streamRipStar.png")).getImage();
			    MouseListener mouseListener = new MouseListener() {
			        public void mouseClicked(MouseEvent e) {
			        	changeStatus();
			        }
			        public void mouseEntered(MouseEvent e) {}
			        public void mouseExited(MouseEvent e) {}
			        public void mousePressed(MouseEvent e) {}
			        public void mouseReleased(MouseEvent e) {}
			    };
			    
			    //build right-click menu
			    PopupMenu popup = new PopupMenu();
			    MenuItem exitItem = new MenuItem("Exit StreamRipStar");
			    MenuItem showMainWindowItem = new MenuItem("Show StreamRipStar");
			    exitItem.addActionListener(new ExitListener(Gui_StreamRipStar.this));
			    showMainWindowItem.addActionListener(new ShowStreamRipStarListener());
			    
			    //visible
			    popup.add(showMainWindowItem);
			    popup.addSeparator();
			    popup.add(exitItem);
	
			    trayIcon = new TrayIcon(image, "StreamRipStar", popup); 
			    trayIcon.setImageAutoSize(true);
			    trayIcon.addMouseListener(mouseListener);
	
			    try {
			        sysTray.add(trayIcon);
			    } catch (AWTException e) {
			        SRSOutput.getInstance().logE("TrayIcon could not be added.");
			    }
			}
		} else {
			if(sysTray != null)
				sysTray.remove(trayIcon);
		}
		
	}