Q:

InputHandler not working

In my game, I have an InputHandler class that handles my action listeners. I have it working for other parts of my game code, but for some reason the key listener does not respond to my inventory class.
In my InputHandler class (it extends JPanel):
public InputHandler(InventoryGUI i) {
    i.addKeyListener(this);
}

In my InventoryGUI constructor:
this.input = new InputHandler(this);

The tick method in the inventory class (the Key i is properly created in my InputHandler):
if (input.i.isPressed() && canChange) {
        canChange = false;
        tickCount = 0;
        Game.removeInventory();
    }

canChange is true. For some reason, the input does not seem to be working. The inventory screen is ticking, but no response from the key listener. Any help would be greatly appreciated!
Edit: Since this class is a JPanel, I tried using KeyBindings, but that still didn't work. I added this to the constructor:
this.getInputMap().put(KeyStroke.getKeyStroke("I"), "pressed");
this.getActionMap().put("pressed", pressedAction);

And pressedAction is created outside:
Action pressedAction = new AbstractAction() {
    private static final long serialVersionUID = 1L;
    public void actionPerformed(ActionEvent e) {
        System.out.println(e.getActionCommand());
        Game.removeInventory();
    }
};

A:

I actually found the solution on my own. Sorry for the lame question, as it was a focus issue. I just needed to call requestFocusInWindow().

