From the code you posted and without having a self contained runnable example its debug. In many cases keyListeners do not work on components because that particular component does not have focus (eg...