public void addItem(){
		int x;
		int y;
		String s = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give x and y coordinates\n"
                + "Seperated by /",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		
		if ((s != null) && (s.length() > 0) && (s.contains("/"))) {
			String[] sar = s.split("/");
			try{
				x = Integer.parseInt(sar[0]);
				y = Integer.parseInt(sar[1]);
			}catch(NumberFormatException e){
				return;
			}
		}else{
			JOptionPane.showMessageDialog(mainWindow, "Input not valid");
			return;
		}
		String name = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the name of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		String[] types = {"weapon","armor","health"};
		String type = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the type of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,types,"weapon");
		String desc = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the description of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		String sprite = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the sprite name of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		sprite = "res\\" + sprite + ".png";
		String w = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the weight of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		int weight;
		try{
			weight = Integer.parseInt(w);
    	}catch(NumberFormatException e){
    		return;
    	}
		String v = (String)JOptionPane.showInputDialog(
                mainWindow,
                "Give the value of the item",
                "Add item",
                JOptionPane.PLAIN_MESSAGE,
                null,null,"");
		int value;
		try{
			value = Integer.parseInt(v);
    	}catch(NumberFormatException e){
    		return;
    	}
		Item2D i = new Item2D(name, desc, weight, ItemType.ItemTypeFromString(type), value, new SerializableBufferedImage(sprite));
		i.setLocation(new Point(x,y));
		items.add(i);
	}