除了getInputMap之外,关于此代码的所有内容都可以正常工作。我看了一遍,找不到原因。在程序中,它说无法找到符号。如果它是JComponent的内置方法,怎么会这样呢?
package dungeon_adventure;
public class Dungeon_Adventure {
public static Dungeon_Adventure_Display Dungeon_Display;
public static void main(String[] args) {
game_engine();
}
private static void game_engine() {
String welcome_text = "Welcome to Dungeon Adventure\nStay a while!\nStay
forever!";
Dungeon_Display = new Dungeon_Adventure_Display();
Dungeon_Display.getInputMap().put("userInput", "myAction");
Dungeon_Display.change_image("square_1.jpg");
Dungeon_Display.add_text(welcome_text);
}
}