public JMud(String title, int xSize, int ySize, Color bgColor, boolean main,boolean menu,int id)
	{
		this.xSize=xSize;
		this.ySize=ySize;
		this.title=title;
		this.bgColor=bgColor;
		this.menu=menu;
		this.id=id;
		this.frame=new JFrame();
		this.jMudPanel = new JMudPanel();
		this.frame.add(jMudPanel);
		if(menu)
		{
			this.menuBar=new JMenuBar();
			this.frame.setJMenuBar(menuBar);
			this.menus[0] = new JMenu("New");
			this.menus[1] = new JMenu("Open");
			this.menuBar.add(menus[0]);
			this.menuBar.add(menus[1]);
			this.items[0] = new JMenuItem("Window");
			this.items[0].addActionListener(new windowActionPerformed());
			this.menus[0].add(this.items[0]);
			this.items[1] = new JMenuItem("Rectangle");
			this.items[1].addActionListener(new rectangleActionPerformed());
			this.menus[0].add(this.items[1]);
			this.items[2] = new JMenuItem("Line");
			this.items[2].addActionListener(new lineActionPerformed());
			this.menus[0].add(this.items[2]);
			this.items[3] = new JMenuItem("Text");
			this.items[3].addActionListener(new textActionPerformed());
			this.menus[0].add(this.items[3]);
			this.items[6] = new JMenuItem("Ellipse");
			this.items[6].addActionListener(new ellipseActionPerformed());
			this.menus[0].add(this.items[6]);
			this.items[7] = new JMenuItem("Circle");
			this.items[7].addActionListener(new circleActionPerformed());
			this.menus[0].add(this.items[7]);
			this.items[8] = new JMenuItem("Examples");
			this.items[8].addActionListener(new examplesActionPerformed());
			this.menus[0].add(this.items[8]);
			this.items[4]=new JMenuItem("TicTacToe");
			this.items[4].addActionListener(new tictactoeActionPerformed());
			this.menus[1].add(this.items[4]);
			this.items[5]=new JMenuItem("FourInARow");
			this.items[5].addActionListener(new fourinarowActionPerformed());
			this.menus[1].add(this.items[5]);
		}
		this.jMudPanel.setPreferredSize(new Dimension(this.xSize, this.ySize));
		this.frame.setLayout(new SpringLayout());
		this.frame.setContentPane(this.jMudPanel);
		this.frame.getContentPane().setBackground(bgColor);
		this.frame.setTitle(title);
		this.main=main;
		this.frame.setAlwaysOnTop(true);
		if(main)
			this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		else
			this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		this.frame.setResizable(false);
		this.frame.setLocationRelativeTo(null);
		this.frame.setSize(xSize,ySize);
		this.frame.pack();
		this.frame.toFront();
		this.jMudPanel.addMouseListener(this);
	}