An object that you expect to listen to events via a key listener requires focus to receive those event...my guess is that's the problem but I don't have time right now to look fully over the code....