public BotManager() {
		try {
			icon = ImageIO.read(new File("./images/", "icon.png"));
			TrayIcon tray = new TrayIcon(icon);
			tray.setImageAutoSize(true);
			tray.setToolTip("Turntable Bot Manager");
			tray.addMouseListener(new MouseAdapter() {
				public void mouseClicked(MouseEvent arg0) {
					if (!isVisible()) {
						setVisible(true);
						setState(0);
					}
				}
			});
			SystemTray.getSystemTray().add(tray);
		} catch (Exception e) {
			e.printStackTrace();
		}
		setIconImage(icon);
		setTitle("Bot Manager");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		this.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent arg0) {
				killAll();
			}
		});
		addWindowStateListener(new WindowStateListener() {
			@Override
			public void windowStateChanged(WindowEvent e) {
				System.out.println(e.getNewState());
				int n = e.getNewState();
				if ((n == 1 || n == 7) && settingsItem.isSelected()) {
					setVisible(false);
				}
			}
		});
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		JMenu mnNewMenu = new JMenu("File");
		menuBar.add(mnNewMenu);

		JMenuItem mntmNewConsole = new JMenuItem("New Bot");
		mntmNewConsole.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				new FileDialog().setVisible(true);
			}
		});
		mnNewMenu.add(mntmNewConsole);

		settingsItem = new JCheckBoxMenuItem("Minimize to tray");
		settingsItem.addMouseListener(new MouseAdapter() {
			public void mouseClicked(MouseEvent arg0) {
				setTray();
			}			
		});
		mnNewMenu.add(settingsItem);

		JMenuItem mntmExit = new JMenuItem("Exit");
		mnNewMenu.add(mntmExit);
		contentPane = new JPanel();
		contentPane.setBorder(null);
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		desktopPane = new JDesktopPane();
		contentPane.add(desktopPane, BorderLayout.CENTER);
	}