public void actionPerformed(ActionEvent e) {
		if (e.getSource() == ok) {
			boolean write = true;
			// get nums and name
			if (x.getText() != null && y.getText() != null
					&& name.getText() != null) {
				try {
					xTiles = java.lang.Integer.parseInt(x.getText());
					yTiles = java.lang.Integer.parseInt(y.getText());
					if(xTiles > 200 || yTiles > 200){
						JOptionPane.showMessageDialog(null,
								"Maps can be no larger than 200 X 200");
						write = false;
					}
				} catch (Exception ex) {
					JOptionPane.showMessageDialog(null,
							"Only numbers can be included in X and Y");
					write = false;
				}
				nameOfMap = name.getText();
				
				if(!(nameOfMap.substring(nameOfMap.length() - 4, nameOfMap.length()).equals(".txt"))){
					nameOfMap += ".txt";
				}
				if(write){
					//Controller.createNewMap(nameOfMap, xTiles, yTiles);
					Map_Edit.curMap = makeMap(xTiles, yTiles);
					this.setVisible(false);
				}
			}else{
				JOptionPane.showMessageDialog(null,
						"Please fill in all the fields");
			}
		}

	}