protected boolean createTrayIcon() {

		try {
			String className = "de.guruz.guruztray.implementation.GuruztrayManagerImplementation";
			Class<?> c = Class.forName(className);
			Object o = c.newInstance();
			this.guruztrayManager = (GuruztrayManager) o;

			// System.out.println ("Tray supported = " +
			// guruztrayManager.isSupported());

			if (!this.guruztrayManager.isSupported()) {
				throw new Exception("Tray not supported");
			}

			Image im_22x22 = null;
			java.net.URL imgURL = Thread.currentThread()
					.getContextClassLoader().getResource(
							"de/guruz/p300/requests/static/trayicon_22x22.png");
			if (imgURL != null) {
				im_22x22 = Toolkit.getDefaultToolkit().createImage(imgURL);
			} else {
				System.err.println("Couldn't load image");
				throw new Exception("Image for tray icon could not be loaded");
			}

			Image im_16x16 = null;
			imgURL = Thread.currentThread().getContextClassLoader()
					.getResource(
							"de/guruz/p300/requests/static/trayicon_16x16.png");
			if (imgURL != null) {
				im_16x16 = Toolkit.getDefaultToolkit().createImage(imgURL);
			} else {
				System.err.println("Couldn't load image");
				throw new Exception("Image for tray icon could not be loaded");
			}

			// test
			// p300.png
			imgURL = Thread.currentThread().getContextClassLoader()
					.getResource(
							"de/guruz/p300/requests/static/p300_bordered.png");
			if (imgURL != null) {
				im_16x16 = Toolkit.getDefaultToolkit().createImage(imgURL);
				im_22x22 = Toolkit.getDefaultToolkit().createImage(imgURL);
			} else {
				System.err.println("Couldn't load image");
				throw new Exception("Image for tray icon could not be loaded");
			}

			PopupMenu pm = new PopupMenu();

			MenuItem mi = null;

			mi = new MenuItem("Show");
			mi.setActionCommand(MainDialog.ACTION_SHOW);
			mi.addActionListener(this);
			pm.add(mi);
			mi = new MenuItem("Open Webinterface");
			mi.setActionCommand(MainDialog.ACTION_OPEN_MY_WEBINTERFACE);
			mi.addActionListener(this);
			pm.add(mi);

			pm.addSeparator();

			mi = new MenuItem("Hide");
			mi.setActionCommand(MainDialog.ACTION_HIDE);
			mi.addActionListener(this);
			// mi.setEnabled(false);
			pm.add(mi);
			mi = new MenuItem("Quit");
			mi.setActionCommand(MainDialog.ACTION_QUIT);
			mi.addActionListener(this);
			// mi.setEnabled(false);
			pm.add(mi);

			pm.addSeparator();

			mi = new MenuItem("About");
			mi.setActionCommand(MainDialog.ACTION_ABOUT);
			mi.addActionListener(this);
			mi.setEnabled(true);
			pm.add(mi);

			this.guruztrayManager.setTrayIcon(im_16x16, im_22x22, "p300", pm);

		} catch (Throwable t) {
			D
					.out("No tray icon supported on this platform or java version (msg=\""
							+ t.getMessage() + "\"");

			// t.printStackTrace();
			return false;
		}
		;

		return (true);

	}