public static void displayInfo(KeyEvent e){
int id = e.getID();
String keyString;
char c = e.getKeyChar();
keyString = ""+c;
if (keyString=="w"){
System.out.print("FACE");
}
}
这是我的代码,无论出于何种原因,它都不起作用。请帮忙?
public static void displayInfo(KeyEvent e){
int id = e.getID();
String keyString;
char c = e.getKeyChar();
keyString = ""+c;
if (keyString=="w"){
System.out.print("FACE");
}
}
这是我的代码,无论出于何种原因,它都不起作用。请帮忙?