public CustomWorld(final World w) {
		
		super();
		
		this.w = w;
		gp.renderWorld(w);
		
		setLayout(new FlowLayout());

		add(xCoorL);
		add(yCoorTF);
		add(yCoorL);
		add(xCoorTF);
		add(doneBut);
		add(cancelBut);
		add(elementBox);
		add(addBut);
		add(gp);
		
		Util.cntrl = new Controller(w);
		
		addBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if(xCoorTF.getText().equals("") || xCoorTF.getText().equals("")){
					JOptionPane.showMessageDialog(null, "Missing one or both coordinates.");
				}
				
				if (inRange(xCoorTF.getText().toString()) &&
						inRange(yCoorTF.getText().toString())) {
					int x = Integer.parseInt(xCoorTF.getText());
					int y = Integer.parseInt(yCoorTF.getText());

					String el = (String)elementBox.getItemAt(elementBox.getSelectedIndex());

					if(el.equals("Beeper")){
						w.setContents(x, y, Contents.BEEPER);
					}else if(el.equals("Wall")){
						w.setContents(x, y, Contents.WALL);
					}else{
						w.setContents(x, y, Contents.NONE);
					}

					Util.cntrl = new Controller(w);
					gp.renderWorld(w);
				} else {
					JOptionPane.showMessageDialog(null, "Coordinates provided are out of range.");
				}
				
				Util.cntrl = new Controller(w);
				gp.renderWorld(w);
				
			}
		});

		doneBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Main.currentWindow.dispose();
				mW = new MainWindow(w.getXSize(), w.getYSize()/*, cntrl*/);
				mW.setVisible(true);
				mW.setSize(1000,600);
				mW.setLocationRelativeTo(null);
				Util.drawWorld(null, null);
				dispose();
			}
		});

		cancelBut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (JOptionPane.showConfirmDialog(null, 
			            "Are you sure you want to close out this window?", 
			            "Cancel Confirmation", JOptionPane.YES_NO_OPTION,
			            JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){
					dispose();
				}
			}
		});
	}