I have a JFrame and I want to trap keyboard events and make decisions on the event before they actually get sent to components within the JFrame. The problem with the java.awt.event.KeyListener class is that it only listens to events and does not intervene and cannot stop them from happening. Does anybody know how to do this?