Changing the Panels of a JFrame “disable” the inputMap of the new Panel inserted
问题 Description of the problem: I have a JFrame, inside this JFrame there is a JPanel with a button, when I press the button an action listener change the current JPanel with a new JPanel, which contains other two JPanels, those two have an inputMap that when the user press the key "up" make something on both of them. The problem is: when I change the JPanel with the new one the "up" key won't do anything. Here is the code: is a SSCCE, so you just have to copy and paste to see what it does. This