public InventoryGrid(final Object parent){
		this.parent = parent;

		setLayout(new BorderLayout());
		
		//if(parent instanceof MainPanel){
			for(Item i : player.getInventory()){
				addElement(i);
			}
			allGridElements.addAll(currList);
		/*} else{
			for(GridElement ge : player.getFavorites()){
				add(ge);
				currList.add(ge);
			}
		}*/
		
		KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        manager.addKeyEventDispatcher(new KeyEventDispatcher(){

			@Override
			public boolean dispatchKeyEvent(KeyEvent arg0) {
				if(parent == Launcher.getFavPanel() && Launcher.getFavPanel().isVisible()){
					handleKeys(arg0);
				} else if(parent == Launcher.getMainPanel() && !Launcher.getFavPanel().isVisible()){
					handleKeys(arg0);
				}
				
	            return false;
			}
        	
        });

	}